mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] IDEA-100199 refresh local changes after external soft reset
.index doesn't change after soft reset, however ORIG_HEAD does.
This commit is contained in:
@@ -40,6 +40,7 @@ public class GitRepositoryFiles {
|
||||
public static final String INFO_EXCLUDE = INFO + "/exclude";
|
||||
public static final String MERGE_HEAD = "MERGE_HEAD";
|
||||
public static final String MERGE_MSG = "MERGE_MSG";
|
||||
public static final String ORIG_HEAD = "ORIG_HEAD";
|
||||
public static final String REBASE_APPLY = "rebase-apply";
|
||||
public static final String REBASE_MERGE = "rebase-merge";
|
||||
public static final String PACKED_REFS = "packed-refs";
|
||||
@@ -60,6 +61,7 @@ public class GitRepositoryFiles {
|
||||
private final String myHeadFilePath;
|
||||
private final String myIndexFilePath;
|
||||
private final String myMergeHeadPath;
|
||||
private final String myOrigHeadPath;
|
||||
private final String myRebaseApplyPath;
|
||||
private final String myRebaseMergePath;
|
||||
private final String myPackedRefsPath;
|
||||
@@ -82,6 +84,7 @@ public class GitRepositoryFiles {
|
||||
myHeadFilePath = gitDirPath + slash(HEAD);
|
||||
myIndexFilePath = gitDirPath + slash(INDEX);
|
||||
myMergeHeadPath = gitDirPath + slash(MERGE_HEAD);
|
||||
myOrigHeadPath = gitDirPath + slash(ORIG_HEAD);
|
||||
myCommitMessagePath = gitDirPath + slash(COMMIT_EDITMSG);
|
||||
myRebaseApplyPath = gitDirPath + slash(REBASE_APPLY);
|
||||
myRebaseMergePath = gitDirPath + slash(REBASE_MERGE);
|
||||
@@ -141,6 +144,13 @@ public class GitRepositoryFiles {
|
||||
return file.equals(myHeadFilePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* .git/ORIG_HEAD
|
||||
*/
|
||||
public boolean isOrigHeadFile(@NotNull String file) {
|
||||
return file.equals(myOrigHeadPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Any file in .git/refs/heads, i.e. a branch reference file.
|
||||
*/
|
||||
|
||||
@@ -266,7 +266,11 @@ public class GitUntrackedFilesHolder implements Disposable, BulkFileListener {
|
||||
}
|
||||
|
||||
private boolean totalRefreshNeeded(@NotNull String path) {
|
||||
return indexChanged(path) || externallyCommitted(path) || gitignoreChanged(path);
|
||||
return indexChanged(path) || externallyCommitted(path) || headMoved(path) || gitignoreChanged(path);
|
||||
}
|
||||
|
||||
private boolean headMoved(@NotNull String path) {
|
||||
return myRepositoryFiles.isOrigHeadFile(path);
|
||||
}
|
||||
|
||||
private boolean indexChanged(@NotNull String path) {
|
||||
|
||||
Reference in New Issue
Block a user