Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b9289f4

Browse files
authored
Merge pull request #47 from github-for-unity/fixes/unlock-context-menu
Fix to properly assess if file is locked/unlocked in context menu
2 parents 0c83f0a + 1076e8a commit b9289f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ private static bool ContextMenu_CanLock()
5252

5353
var alreadyLocked = locks.Any(x =>
5454
{
55-
return repositoryPath == x.Path;
55+
return repositoryPath == x.Path.ToNPath();
5656

5757
});
5858
GitFileStatus status = GitFileStatus.None;
5959
if (entries != null)
6060
{
61-
status = entries.FirstOrDefault(x => repositoryPath == x.Path).Status;
61+
status = entries.FirstOrDefault(x => repositoryPath == x.Path.ToNPath()).Status;
6262
}
6363
return !alreadyLocked && status != GitFileStatus.Untracked && status != GitFileStatus.Ignored;
6464
}
@@ -100,7 +100,7 @@ private static bool ContextMenu_CanUnlock()
100100
NPath assetPath = AssetDatabase.GetAssetPath(selected.GetInstanceID()).ToNPath();
101101
NPath repositoryPath = EntryPoint.Environment.GetRepositoryPath(assetPath);
102102

103-
var isLocked = locks.Any(x => repositoryPath == x.Path);
103+
var isLocked = locks.Any(x => repositoryPath == x.Path.ToNPath());
104104
return isLocked;
105105
}
106106

0 commit comments

Comments
 (0)