git: always get the url to use from the config.xml. Closes #556

This commit is contained in:
Hylke Bons 2012-01-25 18:30:29 +00:00
parent 86cf28e3ae
commit f892fd9c11
2 changed files with 8 additions and 5 deletions

View file

@ -169,7 +169,7 @@ namespace SparkleLib {
public override bool CheckForRemoteChanges () public override bool CheckForRemoteChanges ()
{ {
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Checking for remote changes..."); SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Checking for remote changes...");
SparkleGit git = new SparkleGit (LocalPath, "ls-remote origin master"); SparkleGit git = new SparkleGit (LocalPath, "ls-remote " + Url + " master");
git.Start (); git.Start ();
git.WaitForExit (); git.WaitForExit ();
@ -201,7 +201,7 @@ namespace SparkleLib {
SparkleGit git = new SparkleGit (LocalPath, SparkleGit git = new SparkleGit (LocalPath,
"push --progress " + // Redirects progress stats to standarderror "push --progress " + // Redirects progress stats to standarderror
"origin master"); Url + " master");
git.StartInfo.RedirectStandardError = true; git.StartInfo.RedirectStandardError = true;
git.Start (); git.Start ();
@ -258,7 +258,7 @@ namespace SparkleLib {
public override bool SyncDown () public override bool SyncDown ()
{ {
SparkleGit git = new SparkleGit (LocalPath, "fetch --progress"); SparkleGit git = new SparkleGit (LocalPath, "fetch --progress " + Url);
git.StartInfo.RedirectStandardError = true; git.StartInfo.RedirectStandardError = true;
git.Start (); git.Start ();

View file

@ -60,6 +60,7 @@ namespace SparkleLib {
public readonly SparkleBackend Backend; public readonly SparkleBackend Backend;
public readonly string LocalPath; public readonly string LocalPath;
public readonly string Name; public readonly string Name;
public readonly Uri Url;
public abstract bool AnyDifferences { get; } public abstract bool AnyDifferences { get; }
public abstract string Identifier { get; } public abstract string Identifier { get; }
@ -94,8 +95,10 @@ namespace SparkleLib {
public SparkleRepoBase (string path, SparkleBackend backend) public SparkleRepoBase (string path, SparkleBackend backend)
{ {
LocalPath = path; LocalPath = path;
Name = Path.GetFileName (LocalPath); Name = Path.GetFileName (LocalPath);
Url = new Uri (SparkleConfig.DefaultConfig.GetUrlForFolder (Name));
Backend = backend; Backend = backend;
this.poll_interval = this.short_interval; this.poll_interval = this.short_interval;