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
|
@Entity
|
||||||
public class LineChange extends BaseEntity {
|
public class LineChange extends BaseEntity {
|
||||||
|
|
||||||
private Boolean added;
|
private Boolean added = false;
|
||||||
|
private Boolean removed = false;
|
||||||
private Boolean removed;
|
|
||||||
private String lineFrom;
|
private String lineFrom;
|
||||||
private String lineTo;
|
private String lineTo;
|
||||||
|
|
||||||
|
@ -251,20 +251,32 @@ public class GitRepositoryService {
|
|||||||
if (strings[i].startsWith("---")) {
|
if (strings[i].startsWith("---")) {
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
if (lineChange.getLineFrom() == null) {
|
||||||
i++;
|
lineChange.setLineFrom(strings[i]);
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lineChange.setRemoved(true);
|
||||||
}
|
}
|
||||||
if (strings[i].startsWith("+")) {
|
if (strings[i].startsWith("+")) {
|
||||||
while ((i < stringsLength) && strings[i].startsWith("+")) {
|
while ((i < stringsLength) && strings[i].startsWith("+")) {
|
||||||
if (strings[i].startsWith("+++")) {
|
if (strings[i].startsWith("+++")) {
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
if (lineChange.getLineTo() == null) {
|
||||||
i++;
|
lineChange.setLineTo(strings[i]);
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lineChange.setAdded(true);
|
||||||
}
|
}
|
||||||
if ((lineChange.getLineTo() != null) || (lineChange.getLineFrom() != null)
|
if ((lineChange.getLineTo() != null) || (lineChange.getLineFrom() != null)
|
||||||
|| ((lineChange.getLineTo() != null) && (lineChange.getLineFrom() != null))) {
|
|| ((lineChange.getLineTo() != null) && (lineChange.getLineFrom() != null))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user