diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 79ad2a84..08a3b02d 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -83,14 +83,14 @@ namespace SparkleLib { public override bool Fetch () { - this.git = new SparkleGit (SparkleConfig.DefaultConfig.TmpPath, + this.git = new SparkleGit (base.target_folder, "clone " + "--progress " + // Redirects progress stats to standarderror "\"" + base.remote_url + "\" " + "\"" + base.target_folder + "\""); this.git.StartInfo.RedirectStandardError = true; this.git.Start (); - + double percentage = 1.0; Regex progress_regex = new Regex (@"([0-9]+)%", RegexOptions.Compiled); @@ -270,6 +270,7 @@ namespace SparkleLib { } } + public class SparkleGit : Process { public SparkleGit (string path, string args) : base () diff --git a/SparkleLib/SparkleConfig.cs b/SparkleLib/SparkleConfig.cs index 848c371a..fb68fc07 100755 --- a/SparkleLib/SparkleConfig.cs +++ b/SparkleLib/SparkleConfig.cs @@ -33,11 +33,9 @@ namespace SparkleLib { public static SparkleConfig DefaultConfig = new SparkleConfig (ConfigPath, "config.xml"); - public string FullPath; - public string HomePath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); - public string TmpPath; + public string FoldersPath { get { @@ -48,11 +46,16 @@ namespace SparkleLib { } } + public string TmpPath { + get { + return Path.Combine (FoldersPath, ".tmp"); + } + } + public SparkleConfig (string config_path, string config_file_name) { FullPath = System.IO.Path.Combine (config_path, config_file_name); - TmpPath = Path.Combine (FoldersPath, ".tmp"); if (!Directory.Exists (config_path)) { Directory.CreateDirectory (config_path); diff --git a/SparkleLib/SparkleFetcherBase.cs b/SparkleLib/SparkleFetcherBase.cs index 255c3f0e..5dc5227d 100755 --- a/SparkleLib/SparkleFetcherBase.cs +++ b/SparkleLib/SparkleFetcherBase.cs @@ -162,7 +162,7 @@ namespace SparkleLib { //file_info.FileAccessPermissions = (FileAccessPermissions.UserRead | // FileAccessPermissions.UserWrite); TODO - SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking " + host); + SparkleHelpers.DebugInfo ("Fetcher", "Disabled host key checking for " + host); } diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index e0680429..fd6c6524 100755 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -992,23 +992,24 @@ namespace SparkleShare { try { Directory.Move (tmp_folder, target_folder_path); + + SparkleConfig.DefaultConfig.AddFolder (target_folder_name, this.fetcher.RemoteUrl, backend); + AddRepository (target_folder_path); + + if (FolderFetched != null) + FolderFetched (warnings); + + if (FolderListChanged != null) + FolderListChanged (); + + this.fetcher.Dispose (); + + if (Directory.Exists (tmp_path)) + Directory.Delete (tmp_path, true); + } catch (Exception e) { SparkleHelpers.DebugInfo ("Controller", "Error moving folder: " + e.Message); } - - SparkleConfig.DefaultConfig.AddFolder (target_folder_name, this.fetcher.RemoteUrl, backend); - AddRepository (target_folder_path); - - if (FolderFetched != null) - FolderFetched (warnings); - - if (FolderListChanged != null) - FolderListChanged (); - - this.fetcher.Dispose (); - - if (Directory.Exists (tmp_path)) - Directory.Delete (tmp_path, true); };