repo git: check if remote rev is in local history when determining state. closes #1155
This commit is contained in:
parent
ee4df60f25
commit
1c8ffe407f
|
@ -211,19 +211,27 @@ namespace SparkleLib.Git {
|
||||||
if (git.ExitCode != 0)
|
if (git.ExitCode != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
string remote_revision = output.Substring (0, 40);
|
string remote_revision = "" + output.Substring (0, 40);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty (remote_revision) && !remote_revision.StartsWith (current_revision)) {
|
if (!remote_revision.Equals (current_revision)) {
|
||||||
SparkleLogger.LogInfo ("Git", Name + " | Remote changes found, local: " +
|
git = new SparkleGit (LocalPath, "merge-base " + remote_revision + " master");
|
||||||
current_revision + ", remote: " + remote_revision);
|
git.StartAndWaitForExit ();
|
||||||
|
|
||||||
Error = ErrorStatus.None;
|
if (git.ExitCode != 0) {
|
||||||
return true;
|
SparkleLogger.LogInfo ("Git", Name + " | Remote changes found, local: " +
|
||||||
|
current_revision + ", remote: " + remote_revision);
|
||||||
|
|
||||||
} else {
|
Error = ErrorStatus.None;
|
||||||
SparkleLogger.LogInfo ("Git", Name + " | No remote changes, local+remote: " + current_revision);
|
return true;
|
||||||
return false;
|
|
||||||
}
|
} else {
|
||||||
|
SparkleLogger.LogInfo ("Git", Name + " | Remote " + remote_revision + " is already in our history");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SparkleLogger.LogInfo ("Git", Name + " | No remote changes, local+remote: " + current_revision);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue