Compare commits

..

No commits in common. "c67cdb931f4f649d775f2f3cd70523f5207c4d08" and "93706449be68704b3a88f8bf8f934aab7bbc0230" have entirely different histories.

6 changed files with 11 additions and 40 deletions

View file

@ -32,17 +32,9 @@
return Exec(); return Exec();
} }
public string GetURL(string name, bool isPush) public bool SetURL(string name, string url)
{ {
Args = "remote get-url" + (isPush ? " --push " : " ") + name; Args = $"remote set-url {name} {url}";
var rs = ReadToEnd();
return rs.IsSuccess ? rs.StdOut.Trim() : string.Empty;
}
public bool SetURL(string name, string url, bool isPush)
{
Args = "remote set-url" + (isPush ? " --push " : " ") + $"{name} {url}";
return Exec(); return Exec();
} }
} }

View file

@ -118,15 +118,11 @@ namespace SourceGit.ViewModels
if (_remote.URL != _url) if (_remote.URL != _url)
{ {
var succ = new Commands.Remote(_repo.FullPath).SetURL(_name, _url, false); var succ = new Commands.Remote(_repo.FullPath).SetURL(_name, _url);
if (succ) if (succ)
_remote.URL = _url; _remote.URL = _url;
} }
var pushURL = new Commands.Remote(_repo.FullPath).GetURL(_name, true);
if (pushURL != _url)
new Commands.Remote(_repo.FullPath).SetURL(_name, _url, true);
SetProgressDescription("Post processing ..."); SetProgressDescription("Post processing ...");
new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null); new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);

View file

@ -153,11 +153,7 @@ namespace SourceGit.ViewModels
else if (commits.Count == 1) else if (commits.Count == 1)
{ {
var commit = commits[0] as Models.Commit; var commit = commits[0] as Models.Commit;
_repo.SearchResultSelectedCommit = commit;
if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA)
{
_repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA);
}
AutoSelectedCommit = commit; AutoSelectedCommit = commit;
NavigationId = _navigationId + 1; NavigationId = _navigationId + 1;

View file

@ -465,15 +465,6 @@ namespace SourceGit.ViewModels
private void SwitchWorkspace(Workspace to) private void SwitchWorkspace(Workspace to)
{ {
foreach (var one in Pages)
{
if (one.IsInProgress())
{
App.RaiseException(null, "You have unfinished task(s) in opened pages. Please wait!!!");
return;
}
}
_ignoreIndexChange = true; _ignoreIndexChange = true;
var pref = Preference.Instance; var pref = Preference.Instance;

View file

@ -213,12 +213,7 @@ namespace SourceGit.ViewModels
public bool OnlySearchCommitsInCurrentBranch public bool OnlySearchCommitsInCurrentBranch
{ {
get => _onlySearchCommitsInCurrentBranch; get => _onlySearchCommitsInCurrentBranch;
set set => SetProperty(ref _onlySearchCommitsInCurrentBranch, value);
{
if (SetProperty(ref _onlySearchCommitsInCurrentBranch, value) &&
!string.IsNullOrEmpty(_searchCommitFilter))
StartSearchCommits();
}
} }
public int SearchCommitFilterType public int SearchCommitFilterType
@ -227,12 +222,7 @@ namespace SourceGit.ViewModels
set set
{ {
if (SetProperty(ref _searchCommitFilterType, value)) if (SetProperty(ref _searchCommitFilterType, value))
{
UpdateCurrentRevisionFilesForSearchSuggestion(); UpdateCurrentRevisionFilesForSearchSuggestion();
if (!string.IsNullOrEmpty(_searchCommitFilter))
StartSearchCommits();
}
} }
} }

View file

@ -460,6 +460,12 @@
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>
<Setter Property="Height" Value="50"/> <Setter Property="Height" Value="50"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource Brush.AccentHovered}" />
</Style>
</ListBox.Styles> </ListBox.Styles>
<ListBox.ItemsPanel> <ListBox.ItemsPanel>