Beispiel #1
0
        public override bool Execute()
        {
            try
            {
                var repoInfo = GitRepoInfo.Load(WorkingDirectory);
                Log.LogMessage(MessageImportance.Low, "Resolved git repo info to: RootPath = {0}, GitDir = {1}, HEAD = {2}, Branch = {3}, Hash = {4}",
                               repoInfo.RepositoryRootPath,
                               repoInfo.GitDir,
                               repoInfo.HeadFile,
                               repoInfo.Branch,
                               repoInfo.CommitHash);

                if (string.IsNullOrEmpty(repoInfo.CommitHash))
                {
                    Log.LogError("Could not determine the commit hash of the current git repo in '{0}'.", repoInfo.RepositoryRootPath);
                    return(false);
                }

                CommitHash = repoInfo.CommitHash;
                return(true);
            }
            catch (Exception ex)
            {
                Log.LogError(ex.Message);
                return(false);
            }
        }
Beispiel #2
0
 public ApplicationWindow(IGitRepoAgent gitRepoAgent)
 {
     _gitRepoAgent = gitRepoAgent;
     _gitRepoInfo  = _gitRepoAgent.OpenRepoFolder("D:/VDisk/Github/Samples");
 }