예제 #1
0
 private void SetTitleToGitVersion()
 {
     try
     {
         string output = ProgramPathFinder.ExecuteAndGetOutput(ProgramPathFinder.GetGitBin(),
                                                               "--version");
         this.Title += " - " + output;
     }
     catch (System.IO.FileNotFoundException ex)
     {
         UIService.ShowMessage(ex.Message);
         System.Environment.Exit(1);
     }
 }
예제 #2
0
        static public string GetSignature()
        {
            RunExternal   runner       = new RunExternal(ProgramPathFinder.GetGitBin(), ".");
            List <string> outputs      = runner.Run("config --list");
            string        name_prefix  = "user.name=";
            string        name         = "unknown";
            string        email_prefix = "user.email=";
            string        email        = "*****@*****.**";

            foreach (string output in outputs)
            {
                if (output.StartsWith(name_prefix))
                {
                    name = output.Substring(name_prefix.Length);
                }
                if (output.StartsWith(email_prefix))
                {
                    email = output.Substring(email_prefix.Length);
                }
            }
            return(string.Format("{0} <{1}>", name, email));
        }
예제 #3
0
        private RunExternal CreateGitRunner()
        {
            RunExternal runner = new RunExternal(ProgramPathFinder.GetGitBin(), path_);

            return(runner);
        }