Merge branch '26-bug-with-line' into 'master'
Resolve "Bug: не фиксируются признаки удаления и добавления файлов и строк" Closes #26 See merge request romanov73/git-extractor!24
This commit is contained in:
commit
07ec0e9d84
@ -10,9 +10,8 @@ import javax.persistence.Entity;
|
||||
@Entity
|
||||
public class LineChange extends BaseEntity {
|
||||
|
||||
private Boolean added;
|
||||
|
||||
private Boolean removed;
|
||||
private Boolean added = false;
|
||||
private Boolean removed = false;
|
||||
private String lineFrom;
|
||||
private String lineTo;
|
||||
|
||||
|
@ -251,20 +251,32 @@ public class GitRepositoryService {
|
||||
if (strings[i].startsWith("---")) {
|
||||
i++;
|
||||
} else {
|
||||
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
||||
i++;
|
||||
if (lineChange.getLineFrom() == null) {
|
||||
lineChange.setLineFrom(strings[i]);
|
||||
i++;
|
||||
} else {
|
||||
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
lineChange.setRemoved(true);
|
||||
}
|
||||
if (strings[i].startsWith("+")) {
|
||||
while ((i < stringsLength) && strings[i].startsWith("+")) {
|
||||
if (strings[i].startsWith("+++")) {
|
||||
i++;
|
||||
} else {
|
||||
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
||||
i++;
|
||||
if (lineChange.getLineTo() == null) {
|
||||
lineChange.setLineTo(strings[i]);
|
||||
i++;
|
||||
} else {
|
||||
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
lineChange.setAdded(true);
|
||||
}
|
||||
if ((lineChange.getLineTo() != null) || (lineChange.getLineFrom() != null)
|
||||
|| ((lineChange.getLineTo() != null) && (lineChange.getLineFrom() != null))) {
|
||||
|
Loading…
Reference in New Issue
Block a user