repo git: fix getting stuck in conflict resolution loop when there are no conflicts

This commit is contained in:
Hylke Bons 2012-11-20 20:33:02 +00:00
parent d403e80e04
commit 8948837a59
2 changed files with 13 additions and 16 deletions

View file

@ -49,8 +49,7 @@ namespace SparkleLib.Git {
if (string.IsNullOrEmpty (this.cached_branch)) { if (string.IsNullOrEmpty (this.cached_branch)) {
string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine (); string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();
if (Directory.Exists (rebase_apply_path)) { while (Directory.Exists (rebase_apply_path) && HasLocalChanges) {
while (HasLocalChanges) {
try { try {
ResolveConflict (); ResolveConflict ();
@ -58,7 +57,6 @@ namespace SparkleLib.Git {
SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")"); SparkleLogger.LogInfo ("Git", Name + " | Failed to resolve conflict, trying again... (" + e.Message + ")");
} }
} }
}
SparkleGit git = new SparkleGit (LocalPath, "rev-parse --abbrev-ref HEAD"); SparkleGit git = new SparkleGit (LocalPath, "rev-parse --abbrev-ref HEAD");
this.cached_branch = git.StartAndReadStandardOutput (); this.cached_branch = git.StartAndReadStandardOutput ();
@ -477,8 +475,9 @@ namespace SparkleLib.Git {
} }
SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out..."); SparkleLogger.LogInfo ("Git", Name + " | Conflict detected, trying to get out...");
string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();
while (HasLocalChanges) { while (Directory.Exists (rebase_apply_path) && HasLocalChanges) {
try { try {
ResolveConflict (); ResolveConflict ();

View file

@ -230,12 +230,10 @@ namespace SparkleShare {
Environment.SetEnvironmentVariable ("SSH_AUTH_SOCK", auth_sock_match.Groups [1].Value); Environment.SetEnvironmentVariable ("SSH_AUTH_SOCK", auth_sock_match.Groups [1].Value);
if (ssh_pid_match.Success) { if (ssh_pid_match.Success) {
string ssh_pid = ssh_pid_match.Groups [1].Value; Int32.TryParse (ssh_pid_match.Groups [1].Value, out this.ssh_agent_pid);
Environment.SetEnvironmentVariable ("SSH_AGENT_PID", this.ssh_agent_pid);
Int32.TryParse (ssh_pid, out this.ssh_agent_pid); SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=" + this.ssh_agent_pid);
Environment.SetEnvironmentVariable ("SSH_AGENT_PID", ssh_pid);
SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=" + ssh_pid);
} else { } else {
SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=Unknown"); SparkleLogger.LogInfo ("Controller", "ssh-agent started, PID=Unknown");