Revert "fix handling of paths to be able to clone a github repo (#7)"

This reverts commit 590b8e3a38.

This is fixed slightly different in the winforms branch, so
want to revert it for a clean merge.
This commit is contained in:
wimh 2011-08-13 23:16:43 +02:00
parent 590b8e3a38
commit 55f56c7937
2 changed files with 3 additions and 5 deletions

View file

@ -964,8 +964,7 @@ namespace SparkleShare {
Directory.CreateDirectory (SparklePaths.SparkleTmpPath);
// Strip the '.git' from the name
string canonical_name = Regex.Replace (remote_folder, @"\..*$", "");
canonical_name = Regex.Replace (remote_folder, @"^.*/", "");
string canonical_name = Path.GetFileNameWithoutExtension (remote_folder);
string tmp_folder = Path.Combine (SparklePaths.SparkleTmpPath, canonical_name);
SparkleFetcherBase fetcher = null;
@ -1010,7 +1009,7 @@ namespace SparkleShare {
try {
Directory.Move (tmp_folder, target_folder_path);
} catch (Exception e) {
SparkleHelpers.DebugInfo ("Controller", String.Format ("Error moving folder from {0} to {1}: {2}", tmp_folder, target_folder_path, e.Message));
SparkleHelpers.DebugInfo ("Controller", "Error moving folder: " + e.Message);
}
SparkleConfig.DefaultConfig.AddFolder (target_folder_name, fetcher.RemoteUrl, backend);

View file

@ -17,7 +17,6 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
namespace SparkleShare {
@ -101,7 +100,7 @@ namespace SparkleShare {
public void AddPageCompleted (string server, string folder_name)
{
this.syncing_folder = Regex.Replace (folder_name, @"\..*$", "");
this.syncing_folder = Path.GetFileNameWithoutExtension (folder_name);
this.previous_server = server;
this.previous_folder = folder_name;