diff options
author | Alan McGovern <alan.mcgovern@gmail.com> | 2012-01-19 22:00:09 +0400 |
---|---|---|
committer | Alan McGovern <alan.mcgovern@gmail.com> | 2012-01-19 22:00:09 +0400 |
commit | bd59ec23d2e58b96f6f076e50560a4ba2273e429 (patch) | |
tree | 1d24e809255115845c39432ed9f47154a3630170 /main/src | |
parent | 5885cac80546a324199c31965cbfeea984773536 (diff) |
[Git] Resolve issues getting the status of a single file
I am unsure whether this is a bug in jgit or simply a result of it not
supporting git submodules yet, but it incorrectly includes submodule
directories when calculating the status of a single file. Fixes bug
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/RepositoryStatus.cs | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/RepositoryStatus.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/RepositoryStatus.cs index 4aada9f2a3..b7aa17835d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/RepositoryStatus.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/RepositoryStatus.cs @@ -184,28 +184,39 @@ namespace MonoDevelop.VersionControl.Git void UpdateSingleFiles (List<string> singleFiles) { + // NGIT HACK: We verify that all the files listed in the result of + // the GitStatus call are actually in the list of files we're interested + // in. This is because NGit cannot properly filter the git tree and + // incorrectly includes extra directories. See bug # var status = new SpecificStatus (Repository, singleFiles).Call (); - + foreach (var v in status.GetAdded ()) - Added.Add (v); - + if (singleFiles.Contains (v)) + Added.Add (v); + foreach (var v in status.GetChanged ()) - Modified.Add (v); - + if (singleFiles.Contains (v)) + Modified.Add (v); + foreach (var v in status.GetConflicting ()) - MergeConflict.Add (v); - + if (singleFiles.Contains (v)) + MergeConflict.Add (v); + foreach (var v in status.GetMissing ()) - Missing.Add (v); - + if (singleFiles.Contains (v)) + Missing.Add (v); + foreach (var v in status.GetModified ()) - Modified.Add (v); - + if (singleFiles.Contains (v)) + Modified.Add (v); + foreach (var v in status.GetRemoved ()) - Removed.Add (v); + if (singleFiles.Contains (v)) + Removed.Add (v); foreach (var v in status.GetUntracked ()) - Untracked.Add (v); + if (singleFiles.Contains (v)) + Untracked.Add (v); } /// <summary> |