mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Fix resetting or rebasing a branch to its upstream when the upstream branch name is different
This commit is contained in:
parent
33e81f717d
commit
009062534e
3 changed files with 1 additions and 18 deletions
|
@ -294,7 +294,7 @@ func (self *BranchesController) viewUpstreamOptions(selectedBranch *models.Branc
|
|||
}
|
||||
|
||||
upstream := lo.Ternary(selectedBranch.RemoteBranchStoredLocally(),
|
||||
fmt.Sprintf("%s/%s", selectedBranch.UpstreamRemote, selectedBranch.Name),
|
||||
selectedBranch.ShortUpstreamRefName(),
|
||||
self.c.Tr.UpstreamGenericName)
|
||||
upstreamResetOptions := utils.ResolvePlaceholderString(
|
||||
self.c.Tr.ViewUpstreamResetOptions,
|
||||
|
|
|
@ -65,10 +65,7 @@ var RebaseToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Upstream options")).
|
||||
/* EXPECTED:
|
||||
Select(Contains("Rebase checked-out branch onto origin/master...")).
|
||||
ACTUAL: */
|
||||
Select(Contains("Rebase checked-out branch onto origin/master-local...")).
|
||||
Confirm()
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Rebase 'target'")).
|
||||
|
|
|
@ -59,27 +59,14 @@ var ResetToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Upstream options")).
|
||||
/* EXPECTED:
|
||||
Select(Contains("Reset checked-out branch onto origin/soft-branch...")).
|
||||
ACTUAL: */
|
||||
Select(Contains("Reset checked-out branch onto origin/soft-branch-local...")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Menu().
|
||||
/* EXPECTED:
|
||||
Title(Equals("Reset to origin/soft-branch")).
|
||||
ACTUAL: */
|
||||
Title(Equals("Reset to origin/soft-branch-local")).
|
||||
Select(Contains("Soft reset")).
|
||||
Confirm()
|
||||
|
||||
// Bug: the command fails
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
Content(Contains("fatal: ambiguous argument 'origin/soft-branch-local': unknown revision or path not in the working tree.")).
|
||||
Confirm()
|
||||
})
|
||||
/* Since the command failed, the following assertions are not valid
|
||||
t.Views().Commits().Lines(
|
||||
Contains("soft commit"),
|
||||
Contains("hard commit"),
|
||||
|
@ -88,7 +75,6 @@ var ResetToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Contains("file-1").Contains("A"),
|
||||
Contains("file-2").Contains("A"),
|
||||
)
|
||||
*/
|
||||
|
||||
// hard reset
|
||||
t.Views().Branches().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue