Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from GDKsoftware/Adding-extra-logging
Browse files Browse the repository at this point in the history
Added logging
  • Loading branch information
partouf authored Jun 21, 2017
2 parents d41eba4 + 194152a commit ffee854
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions GitBitterLib/Implementations/GitSharpCloner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ private void LoadSettings()
identity = new Identity(gitConfig.UserName, gitConfig.UserEmail);
}

private bool MessageProgressHandler(string logmessage)
{
var logging = GitBitterContainer.Default.Resolve<IGitBitterLogging>();
logging.Add(logmessage, LoggingLevel.Info);
return true;
}

private string GetUrlForRepository(string repository)
{
if (gitConfig.UseSSH)
Expand Down Expand Up @@ -58,6 +65,10 @@ public Task Clone(string repository, string rootdir, string repodir, string bran
var fullRepoPath = Path.Combine(rootdir, repodir);
stage = "cloning";
logging.Add("Starting cloning " + repodir, LoggingLevel.Info);
options.OnProgress = MessageProgressHandler;
Repository.Clone(url, fullRepoPath, options);
logging.Add("Finished cloning " + repodir, LoggingLevel.Info);
Expand Down Expand Up @@ -107,6 +118,8 @@ public Task ResetAndUpdateExisting(string repository, string rootdir, string rep
}
stage = "pull";
options.FetchOptions.OnProgress = MessageProgressHandler;
Commands.Pull(repo, sig, options);
var branch = GetOrCreateLocalBranch(repo, branchname);
Expand Down

0 comments on commit ffee854

Please sign in to comment.