lib: Check if we're in the middle on a rebase on startup, if so: abort
This commit is contained in:
parent
25e8da9308
commit
34edbbb99e
|
@ -37,8 +37,16 @@ namespace SparkleLib.Git {
|
|||
SparkleGit git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
|
||||
git.Start ();
|
||||
git.WaitForExit ();
|
||||
|
||||
|
||||
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 {
|
||||
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");
|
||||
git.Start ();
|
||||
|
||||
|
@ -141,7 +142,7 @@ namespace SparkleLib.Git {
|
|||
git.WaitForExit ();
|
||||
|
||||
if (git.ExitCode == 0)
|
||||
return output.TrimEnd ();
|
||||
return output.Trim ();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -402,19 +402,15 @@ namespace SparkleShare {
|
|||
|
||||
public void OnFolderActivity (object o, FileSystemEventArgs args)
|
||||
{
|
||||
if (args != null &&
|
||||
args.ChangeType == WatcherChangeTypes.Created &&
|
||||
args.FullPath.EndsWith (".xml")) {
|
||||
if (args != null && args.FullPath.EndsWith (".xml") &&
|
||||
args.ChangeType == WatcherChangeTypes.Created) {
|
||||
|
||||
HandleInvite (args);
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (Directory.Exists (args.FullPath) &&
|
||||
args.ChangeType == WatcherChangeTypes.Created) {
|
||||
|
||||
if (Directory.Exists (args.FullPath) && args.ChangeType == WatcherChangeTypes.Created)
|
||||
return;
|
||||
}
|
||||
|
||||
CheckRepositories ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue