Skip to content

Commit

Permalink
Removed Diff and Revert options from ignored files
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonradivoev committed Dec 27, 2017
1 parent 5a67f7d commit 905f57a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Assets/Plugins/UniGit/Editor/GitDiffWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ private void ClearSelection()
public void AddItemsToMenu(GenericMenu menu)
{
BuildCommitMenu(menu);
menu.AddItem(new GUIContent("Reload"),false, ReloadCallback);
menu.AddItem(new GUIContent("Donate"),false, ()=>{GitLinks.GoTo(GitLinks.Donate);});
menu.AddItem(new GUIContent("Help"),false, ()=>{GitLinks.GoTo(GitLinks.DiffWindowHelp);});
}
Expand Down Expand Up @@ -1276,7 +1277,7 @@ private void DoDiffElementContex(IGenericMenu editMenu)
editMenu.AddItem(new GUIContent("Resolve (Using Ours)"), false, ResolveConflictsOursCallback, entries[0].Path);
editMenu.AddItem(new GUIContent("Resolve (Using Theirs)"), false, ResolveConflictsTheirsCallback, entries[0].Path);
}
else
else if(!selectedFlags.IsFlagSet(FileStatus.Ignored))
{
if (entries[0].MetaChange == (MetaChangeEnum.Object | MetaChangeEnum.Meta))
{
Expand All @@ -1297,11 +1298,20 @@ private void DoDiffElementContex(IGenericMenu editMenu)
{
editMenu.AddItem(new GUIContent("Difference with previous version", diffIcon), false, () => { SeeDifferencePrevAuto(entries[0]); });
}

}
else
{
editMenu.AddDisabledItem(new GUIContent("Difference", diffIcon));
editMenu.AddDisabledItem(new GUIContent("Difference with previous version", diffIcon));
}
editMenu.AddSeparator("");
}
editMenu.AddItem(new GUIContent("Revert", GitGUI.Textures.AnimationWindow), false, RevertSelectedCallback);

if(selectedFlags.IsFlagSet(FileStatus.Ignored))
editMenu.AddDisabledItem(new GUIContent("Revert", GitGUI.Textures.AnimationWindow));
else
editMenu.AddItem(new GUIContent("Revert", GitGUI.Textures.AnimationWindow), false, RevertSelectedCallback);

if (entries.Length == 1)
{
editMenu.AddSeparator("");
Expand Down

0 comments on commit 905f57a

Please sign in to comment.