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;
|
||||||
|
|
||||||
|
@ -250,22 +250,34 @@ public class GitRepositoryService {
|
|||||||
while ((i < stringsLength) && strings[i].startsWith("-")) {
|
while ((i < stringsLength) && strings[i].startsWith("-")) {
|
||||||
if (strings[i].startsWith("---")) {
|
if (strings[i].startsWith("---")) {
|
||||||
i++;
|
i++;
|
||||||
|
} else {
|
||||||
|
if (lineChange.getLineFrom() == null) {
|
||||||
|
lineChange.setLineFrom(strings[i]);
|
||||||
|
i++;
|
||||||
} else {
|
} else {
|
||||||
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
lineChange.setLineFrom(lineChange.getLineFrom() + "\n" + strings[i]);
|
||||||
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 {
|
||||||
|
if (lineChange.getLineTo() == null) {
|
||||||
|
lineChange.setLineTo(strings[i]);
|
||||||
|
i++;
|
||||||
} else {
|
} else {
|
||||||
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
lineChange.setLineTo(lineChange.getLineTo() + "\n" + strings[i]);
|
||||||
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))) {
|
||||||
fileChange.getLineChanges().add(lineChange);
|
fileChange.getLineChanges().add(lineChange);
|
||||||
|
Loading…
Reference in New Issue
Block a user