} // End Function HasChanges public virtual void UnleashHeavok(string path) { NGit.Api.Git repository = NGit.Api.Git.Open(path); // Get the current branch status NGit.Api.Status status = repository.Status().Call(); // You can also access other collections related to the status System.Collections.Generic.ICollection <string> added = status.GetAdded(); System.Collections.Generic.ICollection <string> changed = status.GetChanged(); System.Collections.Generic.ICollection <string> removed = status.GetRemoved(); // Clean our working copy System.Collections.Generic.ICollection <string> clean = repository.Clean().Call(); // Add all files to the stage (you could also be more specific) NGit.Dircache.DirCache add = repository.Add() .AddFilepattern(".") .Call(); // Remove files from the stage NGit.Dircache.DirCache remove = repository.Rm() .AddFilepattern(".gitignore") .Call(); CloseRepository(repository); } // End Sub UnleashHeavok
private void Fetch() { var credentialsProvider = new UsernamePasswordCredentialsProvider(_settings.Login, _settings.Password); _git.Clean().Call(); _git.Fetch().SetTimeout(PluginSettings.LoadInt(ConnectionTimeoutInSecondsSectionName, 0)).SetCredentialsProvider(credentialsProvider).SetRemoveDeletedRefs(true).Call(); }
private void Fetch() { var credentialsProvider = new UsernamePasswordCredentialsProvider(_settings.Login, _settings.Password); _git.Clean().Call(); _git.Fetch().SetCredentialsProvider(credentialsProvider).SetRemoveDeletedRefs(true).Call(); }