Esempio n. 1
0
		void GetDirectoryVersionInfoCore (NGit.Repository repository, GitRevision rev, FilePath [] localPaths, HashSet<FilePath> existingFiles, HashSet<FilePath> nonVersionedMissingFiles, List<VersionInfo> versions)
		{
			
			var status = new FilteredStatus (repository, repository.ToGitPath (localPaths)).Call (); 
			HashSet<string> added = new HashSet<string> ();
			Action<IEnumerable<string>, VersionStatus> AddFiles = delegate(IEnumerable<string> files, VersionStatus fstatus) {
				foreach (string file in files) {
					if (!added.Add (file))
						continue;
					FilePath statFile = repository.FromGitPath (file);
					existingFiles.Remove (statFile.CanonicalPath);
					nonVersionedMissingFiles.Remove (statFile.CanonicalPath);
					versions.Add (new VersionInfo (statFile, "", false, fstatus, rev, VersionStatus.Versioned, null));
				}
			};
			
			AddFiles (status.GetAdded (), VersionStatus.Versioned | VersionStatus.ScheduledAdd);
			AddFiles (status.GetChanged (), VersionStatus.Versioned | VersionStatus.Modified);
			AddFiles (status.GetModified (), VersionStatus.Versioned | VersionStatus.Modified);
			AddFiles (status.GetRemoved (), VersionStatus.Versioned | VersionStatus.ScheduledDelete);
			AddFiles (status.GetMissing (), VersionStatus.Versioned | VersionStatus.ScheduledDelete);
			AddFiles (status.GetConflicting (), VersionStatus.Versioned | VersionStatus.Conflicted);
			AddFiles (status.GetUntracked (), VersionStatus.Unversioned);
		}
Esempio n. 2
0
		public static RepositoryStatus GetDirectoryStatus (NGit.Repository repo, string dir, bool recursive)
		{
			return new RepositoryStatus (repo, null, repo.ToGitPath (dir), recursive);
		}
Esempio n. 3
0
		public static RepositoryStatus GetFileStatus (NGit.Repository repo, string fileName)
		{
			return new RepositoryStatus (repo, repo.ToGitPath (fileName), null, false);
		}
Esempio n. 4
0
		public static RepositoryStatus GetFileStatus (NGit.Repository repo, IEnumerable<FilePath> fileNames)
		{
			return new RepositoryStatus (repo, repo.ToGitPath (fileNames), null, false);
		}