diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index d73d6bb7..aaba4824 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -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; } diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index e8e46e61..ba7283f9 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -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 (); }