Skip to content

Commit

Permalink
Fix slide in suggestion on the repo that is not selected at the moment (
Browse files Browse the repository at this point in the history
closes #1529) - 1st round of fixes
  • Loading branch information
mkondratek committed Feb 13, 2023
1 parent fd3f50a commit 301965e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ public IGitMacheteRepositorySnapshot createSnapshot(BranchLayout branchLayout) t
val operationsBaseBranchName = deriveOngoingOperationsBaseBranchName(ongoingOperationType);

return new GitMacheteRepositorySnapshot(mainGitDirectoryPath, List.narrow(rootBranches), branchLayout,
currentBranchIfManaged,
managedBranchByName, duplicatedBranchNames, skippedBranchNames, preRebaseHookExecutor,
currentBranchIfManaged, managedBranchByName, duplicatedBranchNames, skippedBranchNames, preRebaseHookExecutor,
new IGitMacheteRepositorySnapshot.OngoingRepositoryOperation(ongoingOperationType, operationsBaseBranchName));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ private void trackCurrentBranchChange(GitRepository repository) {
}
val snapshot = gitMacheteRepositorySnapshot;
val mainGitDirectory = GitVfsUtils.getMainGitDirectory(repository);
// 1. As for now, only the snapshot of the repository selected in Git Machete panel is available
// (not all snapshots of all repositories!).
// 2. The unmanaged branch notification works on the same snapshot as the one selected in Git Machete panel.
// Hence, we must assure that the current branch changed belongs to the same repository as the given snapshot.
// TODO (#1542): A handling of all repositories (not only selected) is a subject to of improvement.
if (snapshot != null && snapshot.getMainGitDirectoryPath().equals(mainGitDirectory)) {
val entry = snapshot.getBranchLayout().getEntryByName(repositoryCurrentBranchName);
if (entry == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ public boolean test(JavaMethod method) {
"java.nio.file.Files.isRegularFile(java.nio.file.Path, [Ljava.nio.file.LinkOption;)",
"java.nio.file.Files.readAttributes(java.nio.file.Path, java.lang.Class, [Ljava.nio.file.LinkOption;)",
"java.nio.file.Files.setLastModifiedTime(java.nio.file.Path, java.nio.file.attribute.FileTime)",
"java.nio.file.Path.equals(java.lang.Object)",
"java.nio.file.Path.getFileName()",
"java.nio.file.Path.getParent()",
"java.nio.file.Path.of(java.lang.String, [Ljava.lang.String;)",
"java.nio.file.Path.resolve(java.lang.String)",
"java.nio.file.Path.toAbsolutePath()",
"java.nio.file.Path.toFile()",
Expand Down

0 comments on commit 301965e

Please sign in to comment.