mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix<Remote>: do NOT validate remote's name when edit only remote's URL
This commit is contained in:
parent
8b538e7963
commit
be8098ebe3
1 changed files with 8 additions and 4 deletions
|
@ -31,8 +31,10 @@ namespace SourceGit.Views.Popups {
|
|||
}
|
||||
|
||||
public override Task<bool> Start() {
|
||||
if (remote == null || remote.Name != RemoteName) {
|
||||
txtName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||
if (Validation.GetHasError(txtName)) return null;
|
||||
}
|
||||
|
||||
txtUrl.GetBindingExpression(TextBox.TextProperty).UpdateSource();
|
||||
if (Validation.GetHasError(txtUrl)) return null;
|
||||
|
@ -44,11 +46,13 @@ namespace SourceGit.Views.Popups {
|
|||
if (succ) new Commands.Fetch(repo.Path, RemoteName, true, UpdateProgress).Exec();
|
||||
} else {
|
||||
if (remote.URL != RemoteURL) {
|
||||
new Commands.Remote(repo.Path).SetURL(remote.Name, RemoteURL);
|
||||
var succ = new Commands.Remote(repo.Path).SetURL(remote.Name, RemoteURL);
|
||||
if (succ) remote.URL = RemoteURL;
|
||||
}
|
||||
|
||||
if (remote.Name != RemoteName) {
|
||||
new Commands.Remote(repo.Path).Rename(remote.Name, RemoteName);
|
||||
var succ = new Commands.Remote(repo.Path).Rename(remote.Name, RemoteName);
|
||||
if (succ) remote.Name = RemoteName;
|
||||
}
|
||||
}
|
||||
Models.Watcher.SetEnabled(repo.Path, true);
|
||||
|
|
Loading…
Reference in a new issue