本文整理汇总了C#中SparkleGit.StartAndReadStandardError方法的典型用法代码示例。如果您正苦于以下问题:C# SparkleGit.StartAndReadStandardError方法的具体用法?C# SparkleGit.StartAndReadStandardError怎么用?C# SparkleGit.StartAndReadStandardError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparkleGit
的用法示例。
在下文中一共展示了SparkleGit.StartAndReadStandardError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rebase
// Merges the fetched changes
private void Rebase()
{
if (HasLocalChanges) {
Add ();
string commit_message = FormatCommitMessage ();
Commit (commit_message);
}
// Temporarily change the ignorecase setting to true to avoid
// conflicts in file names due to case changes
SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase true");
git.StartAndWaitForExit ();
git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
git.StartInfo.RedirectStandardOutput = false;
string error_output = git.StartAndReadStandardError ();
if (git.ExitCode != 0) {
SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
// error: cannot stat 'filename': Permission denied
if (SparkleBackend.Platform != PlatformID.Unix &&
error_output.Contains ("error: cannot stat")) {
// TODO
}
while (HasLocalChanges) {
try {
ResolveConflict ();
} catch (IOException e) {
SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")");
}
}
SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
OnConflictResolved ();
}
git = new SparkleGit (LocalPath, "config core.ignorecase false");
git.StartAndWaitForExit ();
}
示例2: Rebase
// Merges the fetched changes
private bool Rebase()
{
if (HasLocalChanges) {
Add ();
string commit_message = FormatCommitMessage ();
Commit (commit_message);
}
// Temporarily change the ignorecase setting to true to avoid
// conflicts in file names due to case changes
SparkleGit git = new SparkleGit (LocalPath, "config core.ignorecase true");
git.StartAndWaitForExit ();
git = new SparkleGit (LocalPath, "rebase FETCH_HEAD");
git.StartInfo.RedirectStandardOutput = false;
string error_output = git.StartAndReadStandardError ();
if (git.ExitCode != 0) {
// Stop when we can't rebase due to locked local files
// error: cannot stat 'filename': Permission denied
if (error_output.Contains ("error: cannot stat")) {
Error = ErrorStatus.LockedFiles;
SparkleLogger.LogInfo ("Git", Name + " | Error status changed to " + Error);
git = new SparkleGit (LocalPath, "rebase --abort");
git.StartAndWaitForExit ();
git = new SparkleGit (LocalPath, "config core.ignorecase false");
git.StartAndWaitForExit ();
return false;
} else {
SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();
while (Directory.Exists (rebase_apply_path) && HasLocalChanges) {
try {
ResolveConflict ();
} catch (IOException e) {
SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again...", e);
}
}
SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
OnConflictResolved ();
}
}
git = new SparkleGit (LocalPath, "config core.ignorecase false");
git.StartAndWaitForExit ();
return true;
}
示例3: Merge
// Merges the fetched changes
private bool Merge()
{
string message = FormatCommitMessage ();
if (message != null) {
Add ();
Commit (message);
}
SparkleGit git;
// Stop if we're already in a merge because something went wrong
if (this.in_merge) {
git = new SparkleGit (LocalPath, "merge --abort");
git.StartAndWaitForExit ();
return false;
}
// Temporarily change the ignorecase setting to true to avoid
// conflicts in file names due to letter case changes
git = new SparkleGit (LocalPath, "config core.ignorecase true");
git.StartAndWaitForExit ();
git = new SparkleGit (LocalPath, "merge FETCH_HEAD");
git.StartInfo.RedirectStandardOutput = false;
string error_output = git.StartAndReadStandardError ();
if (git.ExitCode != 0) {
// Stop when we can't merge due to locked local files
// error: cannot stat 'filename': Permission denied
if (error_output.Contains ("error: cannot stat")) {
Error = ErrorStatus.UnreadableFiles;
SparkleLogger.LogInfo ("Git", Name + " | Error status changed to " + Error);
git = new SparkleGit (LocalPath, "merge --abort");
git.StartAndWaitForExit ();
git = new SparkleGit (LocalPath, "config core.ignorecase false");
git.StartAndWaitForExit ();
return false;
} else {
SparkleLogger.LogInfo ("Git", error_output);
SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
while (this.in_merge && HasLocalChanges) {
try {
ResolveConflict ();
} catch (IOException e) {
SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again...", e);
}
}
SparkleLogger.LogInfo ("Git", Name + " | Conflict resolved");
}
}
git = new SparkleGit (LocalPath, "config core.ignorecase false");
git.StartAndWaitForExit ();
return true;
}