mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] IDEA-89296 EA-30807 Rename change may have only 1 path
So don't require it. For example, in 'git show --name-status -M' for a merge commit, where the file was renamed in one of the branches.
This commit is contained in:
@@ -235,7 +235,9 @@ class GitLogRecord {
|
||||
break;
|
||||
case RENAMED:
|
||||
status = FileStatus.MODIFIED;
|
||||
final FilePath filePathAfterRename = GitContentRevision.createPath(vcsRoot, statusInfo.getSecondPath(), false, false, true);
|
||||
String secondPath = statusInfo.getSecondPath();
|
||||
final FilePath filePathAfterRename = GitContentRevision.createPath(vcsRoot, secondPath == null ? path : secondPath,
|
||||
false, false, true);
|
||||
after = GitContentRevision.createMultipleParentsRevision(project, filePathAfterRename, parentRevisions);
|
||||
before = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, true, true, true);
|
||||
break;
|
||||
|
||||
@@ -43,11 +43,11 @@ class GitLogStatusInfo {
|
||||
* SecondPath == null iff it the type is rename
|
||||
*/
|
||||
private static void verifyParameters(@NotNull GitChangeType type, @NotNull String path, @Nullable String secondPath) {
|
||||
if (type.requiresSecondPath()) {
|
||||
LOG.assertTrue(secondPath != null, String.format("Rename change should have the second path. type=%s, path1=%s, path2=%s", type, path, secondPath));
|
||||
} else {
|
||||
if (!type.requiresSecondPath()) {
|
||||
LOG.assertTrue(secondPath == null, String.format("Second path should be null. type=%s, path1=%s, path2=%s", type, path, secondPath));
|
||||
}
|
||||
// rename change doesn't require the second path:
|
||||
// for example, if it is a merge commit when the file was renamed in one and only one of the branches
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user