private void btnPull_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(ProjectPath)) { return; } string pullCmdStr = "pull"; bool isAsnc = true; if (isAsnc) { var cmdStream = GitCmd.RunStream(pullCmdStr, ProjectPath); Task <string> line; while ((line = cmdStream.ReadLineAsync()) != null) { if (line.Result == null) { break; } AppendOutLog(line.Result); } cmdStream.Close(); } else { string result = GitCmd.Run(pullCmdStr, ProjectPath); AppendOutLog(result); } }
public void Show() { var args = Parse( maxArgs: 1, minArgs: 1 ); var line = GitCmd.Execute($"ls-files -s {args[0]}").ReadToEnd(); if (string.IsNullOrEmpty(line)) { return; } var stageHash = "stageHash"; var stageNumber = "stageNumber"; //"100644 176a458f94e0ea5272ce67c36bf30b6be9caf623 0\t.gitattributes": text: auto var pattern = $"^\\d*\\s(?<{stageHash}>[a-z0-9]*)\\s(?<{stageNumber}>\\d+)"; var match = Regex.Match(line, pattern, RegexOptions.IgnoreCase); var hash = GitHash.Parse(match.Get(stageHash)); var content = GitCmd.Execute($"cat-file -p {hash}").ReadToEnd(); Console.Write(content); }
public static void Git(string arguments) => GitCmd.Execute(arguments);
private static void Git(string arguments) { var message = $">git {GitCmd.Execute(arguments).ReadToEnd()}"; Console.WriteLine(message); }
public TempGitDir() { m_tempDir = new TempDir(); GitCmd.Execute($"init"); }