mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
git: remember the previous HEAD position before pull/merge
The revision is used to calculate updated files. It used to work, because Repository.getCurrentRevision returns the cached version which is not updated unless explicitly requested and unless a VFS refresh is received indicating that the HEAD file has changed: the first didn't happen, the latter most likely didn't happen as well, but it is just by luck. GitOrigin-RevId: a44a65db4167dc15a459b481702f62cb0c187519
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f8b51e1906
commit
818660d1a7
@@ -115,6 +115,8 @@ abstract class GitMergeAction extends GitRepositoryAction {
|
||||
}
|
||||
}
|
||||
|
||||
String beforeRevision = repository.getCurrentRevision();
|
||||
|
||||
try (AccessToken ignore = DvcsUtil.workingTreeChangeStarted(project, getActionName())) {
|
||||
GitCommandResult result = git.runCommand(() -> {
|
||||
GitLineHandler handler = handlerProvider.compute();
|
||||
@@ -124,14 +126,11 @@ abstract class GitMergeAction extends GitRepositoryAction {
|
||||
return handler;
|
||||
});
|
||||
|
||||
String revision = repository.getCurrentRevision();
|
||||
if (revision == null) {
|
||||
return;
|
||||
if (beforeRevision != null) {
|
||||
GitRevisionNumber currentRev = new GitRevisionNumber(beforeRevision);
|
||||
handleResult(result, project, mergeConflict, localChangesDetector, untrackedFilesDetector, repository, currentRev, beforeLabel,
|
||||
updatedRanges);
|
||||
}
|
||||
|
||||
GitRevisionNumber currentRev = new GitRevisionNumber(revision);
|
||||
handleResult(result, project, mergeConflict, localChangesDetector, untrackedFilesDetector, repository, currentRev, beforeLabel,
|
||||
updatedRanges);
|
||||
}
|
||||
}
|
||||
}.queue();
|
||||
|
||||
Reference in New Issue
Block a user