repo git: set remote.origin.url from config.xml on startup. #972
This commit is contained in:
parent
93dfffe17a
commit
284234514f
|
@ -28,18 +28,19 @@ namespace SparkleLib.Git {
|
||||||
public class SparkleRepo : SparkleRepoBase {
|
public class SparkleRepo : SparkleRepoBase {
|
||||||
|
|
||||||
private bool user_is_set;
|
private bool user_is_set;
|
||||||
private bool remote_url_is_set;
|
|
||||||
private bool use_git_bin;
|
private bool use_git_bin;
|
||||||
|
|
||||||
|
|
||||||
public SparkleRepo (string path, SparkleConfig config) : base (path, config)
|
public SparkleRepo (string path, SparkleConfig config) : base (path, config)
|
||||||
{
|
{
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
|
SparkleGit git = new SparkleGit (LocalPath, "config --get filter.bin.clean");
|
||||||
git.Start ();
|
git.StartAndWaitForExit ();
|
||||||
git.WaitForExit ();
|
|
||||||
|
|
||||||
this.use_git_bin = (git.ExitCode == 0);
|
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 ();
|
string rebase_apply_path = new string [] { LocalPath, ".git", "rebase-apply" }.Combine ();
|
||||||
|
|
||||||
if (Directory.Exists (rebase_apply_path)) {
|
if (Directory.Exists (rebase_apply_path)) {
|
||||||
|
@ -178,13 +179,6 @@ namespace SparkleLib.Git {
|
||||||
SparkleGit git;
|
SparkleGit git;
|
||||||
|
|
||||||
if (this.use_git_bin) {
|
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");
|
SparkleGitBin git_bin = new SparkleGitBin (LocalPath, "push");
|
||||||
git_bin.StartAndWaitForExit ();
|
git_bin.StartAndWaitForExit ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue