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

Commit

Permalink
Merge pull request #47 from github-for-unity/fixes/unlock-context-menu
Browse files Browse the repository at this point in the history
Fix to properly assess if file is locked/unlocked in context menu
  • Loading branch information
shana authored Jun 28, 2017
2 parents 0c83f0a + 1076e8a commit b9289f4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ private static bool ContextMenu_CanLock()

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;
}
Expand Down Expand Up @@ -100,7 +100,7 @@ private static bool ContextMenu_CanUnlock()
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;
}

Expand Down

0 comments on commit b9289f4

Please sign in to comment.