lib: Check if we're in the middle on a rebase on startup, if so: abort
This commit is contained in:
parent
afd894ac50
commit
687cbd4b60
|
@ -39,6 +39,14 @@ namespace SparkleLib.Git {
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
this.use_git_bin = (git.ExitCode == 0);
|
this.use_git_bin = (git.ExitCode == 0);
|
||||||
|
|
||||||
|
string rebase_apply_path = SparkleHelpers.CombineMore (LocalPath, ".git", "rebase-apply");
|
||||||
|
|
||||||
|
if (Directory.Exists (rebase_apply_path)) {
|
||||||
|
SparkleGit git = new SparkleGit (LocalPath, "rebase --abort");
|
||||||
|
git.Start ();
|
||||||
|
git.WaitForExit ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,13 +135,6 @@ namespace SparkleLib.Git {
|
||||||
|
|
||||||
public override string CurrentRevision {
|
public override string CurrentRevision {
|
||||||
get {
|
get {
|
||||||
// Remove stale rebase-apply files because it
|
|
||||||
// makes the method return the wrong hashes.
|
|
||||||
string rebase_apply_file = SparkleHelpers.CombineMore (LocalPath, ".git", "rebase-apply");
|
|
||||||
|
|
||||||
if (File.Exists (rebase_apply_file))
|
|
||||||
File.Delete (rebase_apply_file);
|
|
||||||
|
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "rev-parse HEAD");
|
SparkleGit git = new SparkleGit (LocalPath, "rev-parse HEAD");
|
||||||
git.Start ();
|
git.Start ();
|
||||||
|
|
||||||
|
@ -141,7 +142,7 @@ namespace SparkleLib.Git {
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
if (git.ExitCode == 0)
|
if (git.ExitCode == 0)
|
||||||
return output.TrimEnd ();
|
return output.Trim ();
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,19 +402,15 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public void OnFolderActivity (object o, FileSystemEventArgs args)
|
public void OnFolderActivity (object o, FileSystemEventArgs args)
|
||||||
{
|
{
|
||||||
if (args != null &&
|
if (args != null && args.FullPath.EndsWith (".xml") &&
|
||||||
args.ChangeType == WatcherChangeTypes.Created &&
|
args.ChangeType == WatcherChangeTypes.Created) {
|
||||||
args.FullPath.EndsWith (".xml")) {
|
|
||||||
|
|
||||||
HandleInvite (args);
|
HandleInvite (args);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (Directory.Exists (args.FullPath) &&
|
if (Directory.Exists (args.FullPath) && args.ChangeType == WatcherChangeTypes.Created)
|
||||||
args.ChangeType == WatcherChangeTypes.Created) {
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
CheckRepositories ();
|
CheckRepositories ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue