repo git: set remote.origin.url from config.xml on startup. #972

This commit is contained in:
Hylke Bons 2012-09-17 11:22:42 +01:00
parent 93dfffe17a
commit 284234514f

View file

@ -28,18 +28,19 @@ namespace SparkleLib.Git {
public class SparkleRepo : SparkleRepoBase {
private bool user_is_set;
private bool remote_url_is_set;
private bool use_git_bin;
public SparkleRepo (string path, SparkleConfig config) : base (path, config)
{
SparkleGit git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
git.Start ();
git.WaitForExit ();
git.StartAndWaitForExit ();
this.use_git_bin = (git.ExitCode == 0);
git = new SparkleGit (LocalPath, "config remote.origin.url \"" + RemoteUrl + "\"");
git.StartAndWaitForExit ();
string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();
if (Directory.Exists (rebase_apply_path)) {
@ -178,13 +179,6 @@ namespace SparkleLib.Git {
SparkleGit git;
if (this.use_git_bin) {
if (this.remote_url_is_set) {
git = new SparkleGit (LocalPath, "config remote.origin.url \"" + RemoteUrl + "\"");
git.StartAndWaitForExit ();
this.remote_url_is_set = true;
}
SparkleGitBin git_bin = new SparkleGitBin (LocalPath, "push");
git_bin.StartAndWaitForExit ();