mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
Compare commits
4 commits
93706449be
...
c67cdb931f
Author | SHA1 | Date | |
---|---|---|---|
|
c67cdb931f | ||
|
6ca6399bd3 | ||
|
b5000f920f | ||
|
c2b17ef9d0 |
6 changed files with 40 additions and 11 deletions
|
@ -32,9 +32,17 @@
|
||||||
return Exec();
|
return Exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SetURL(string name, string url)
|
public string GetURL(string name, bool isPush)
|
||||||
{
|
{
|
||||||
Args = $"remote set-url {name} {url}";
|
Args = "remote get-url" + (isPush ? " --push " : " ") + name;
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,11 +118,15 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
if (_remote.URL != _url)
|
if (_remote.URL != _url)
|
||||||
{
|
{
|
||||||
var succ = new Commands.Remote(_repo.FullPath).SetURL(_name, _url);
|
var succ = new Commands.Remote(_repo.FullPath).SetURL(_name, _url, false);
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,11 @@ 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;
|
||||||
|
|
|
@ -465,6 +465,15 @@ 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;
|
||||||
|
|
|
@ -213,7 +213,12 @@ namespace SourceGit.ViewModels
|
||||||
public bool OnlySearchCommitsInCurrentBranch
|
public bool OnlySearchCommitsInCurrentBranch
|
||||||
{
|
{
|
||||||
get => _onlySearchCommitsInCurrentBranch;
|
get => _onlySearchCommitsInCurrentBranch;
|
||||||
set => SetProperty(ref _onlySearchCommitsInCurrentBranch, value);
|
set
|
||||||
|
{
|
||||||
|
if (SetProperty(ref _onlySearchCommitsInCurrentBranch, value) &&
|
||||||
|
!string.IsNullOrEmpty(_searchCommitFilter))
|
||||||
|
StartSearchCommits();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int SearchCommitFilterType
|
public int SearchCommitFilterType
|
||||||
|
@ -222,7 +227,12 @@ namespace SourceGit.ViewModels
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SetProperty(ref _searchCommitFilterType, value))
|
if (SetProperty(ref _searchCommitFilterType, value))
|
||||||
|
{
|
||||||
UpdateCurrentRevisionFilesForSearchSuggestion();
|
UpdateCurrentRevisionFilesForSearchSuggestion();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_searchCommitFilter))
|
||||||
|
StartSearchCommits();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -460,12 +460,6 @@
|
||||||
<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>
|
||||||
|
|
Loading…
Reference in a new issue