diff --git a/backend/impl/src/main/java/com/virtuslab/gitmachete/backend/impl/aux/CreateGitMacheteRepositoryAux.java b/backend/impl/src/main/java/com/virtuslab/gitmachete/backend/impl/aux/CreateGitMacheteRepositoryAux.java index aa4cf09fa..be976bd7f 100644 --- a/backend/impl/src/main/java/com/virtuslab/gitmachete/backend/impl/aux/CreateGitMacheteRepositoryAux.java +++ b/backend/impl/src/main/java/com/virtuslab/gitmachete/backend/impl/aux/CreateGitMacheteRepositoryAux.java @@ -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)); } diff --git a/frontend/ui/impl/src/main/java/com/virtuslab/gitmachete/frontend/ui/impl/table/EnhancedGraphTable.java b/frontend/ui/impl/src/main/java/com/virtuslab/gitmachete/frontend/ui/impl/table/EnhancedGraphTable.java index 9225d0a48..7f469a1d1 100644 --- a/frontend/ui/impl/src/main/java/com/virtuslab/gitmachete/frontend/ui/impl/table/EnhancedGraphTable.java +++ b/frontend/ui/impl/src/main/java/com/virtuslab/gitmachete/frontend/ui/impl/table/EnhancedGraphTable.java @@ -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) { diff --git a/src/test/java/com/virtuslab/archunit/UIThreadUnsafeMethodInvocationsTestSuite.java b/src/test/java/com/virtuslab/archunit/UIThreadUnsafeMethodInvocationsTestSuite.java index e7a27a917..b2a5422a3 100644 --- a/src/test/java/com/virtuslab/archunit/UIThreadUnsafeMethodInvocationsTestSuite.java +++ b/src/test/java/com/virtuslab/archunit/UIThreadUnsafeMethodInvocationsTestSuite.java @@ -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()",