Skip to content
Snippets Groups Projects
Commit b9289f49 authored by Andreia Gaita's avatar Andreia Gaita Committed by GitHub
Browse files

Merge pull request #47 from github-for-unity/fixes/unlock-context-menu

Fix to properly assess if file is locked/unlocked in context menu
parents 0c83f0a1 1076e8a9
No related branches found
Tags v0.26.1-alpha
No related merge requests found
......@@ -52,13 +52,13 @@ namespace GitHub.Unity
var alreadyLocked = locks.Any(x =>
{
return repositoryPath == x.Path;
return repositoryPath == x.Path.ToNPath();
});
GitFileStatus status = GitFileStatus.None;
if (entries != null)
{
status = entries.FirstOrDefault(x => repositoryPath == x.Path).Status;
status = entries.FirstOrDefault(x => repositoryPath == x.Path.ToNPath()).Status;
}
return !alreadyLocked && status != GitFileStatus.Untracked && status != GitFileStatus.Ignored;
}
......@@ -100,7 +100,7 @@ namespace GitHub.Unity
NPath assetPath = AssetDatabase.GetAssetPath(selected.GetInstanceID()).ToNPath();
NPath repositoryPath = EntryPoint.Environment.GetRepositoryPath(assetPath);
var isLocked = locks.Any(x => repositoryPath == x.Path);
var isLocked = locks.Any(x => repositoryPath == x.Path.ToNPath());
return isLocked;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment