mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 10:22:13 +08:00
fix: for init-commit, app will crash with COMMIT & PUSH due to local branch has not been updated (#1229)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -114,6 +114,9 @@ namespace SourceGit.ViewModels
|
||||
// Set default selected local branch.
|
||||
if (localBranch != null)
|
||||
{
|
||||
if (LocalBranches.Count == 0)
|
||||
LocalBranches.Add(localBranch);
|
||||
|
||||
_selectedLocalBranch = localBranch;
|
||||
HasSpecifiedLocalBranch = true;
|
||||
}
|
||||
|
||||
@@ -1733,7 +1733,18 @@ namespace SourceGit.ViewModels
|
||||
UseAmend = false;
|
||||
|
||||
if (autoPush && _repo.Remotes.Count > 0)
|
||||
_repo.ShowAndStartPopup(new Push(_repo, null));
|
||||
{
|
||||
if (_repo.CurrentBranch == null)
|
||||
{
|
||||
var currentBranchName = Commands.Branch.ShowCurrent(_repo.FullPath);
|
||||
var tmp = new Models.Branch() { Name = currentBranchName };
|
||||
_repo.ShowAndStartPopup(new Push(_repo, tmp));
|
||||
}
|
||||
else
|
||||
{
|
||||
_repo.ShowAndStartPopup(new Push(_repo, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_repo.MarkBranchesDirtyManually();
|
||||
|
||||
Reference in New Issue
Block a user