mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +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(),
|
upstream := lo.Ternary(selectedBranch.RemoteBranchStoredLocally(),
|
||||||
fmt.Sprintf("%s/%s", selectedBranch.UpstreamRemote, selectedBranch.Name),
|
selectedBranch.ShortUpstreamRefName(),
|
||||||
self.c.Tr.UpstreamGenericName)
|
self.c.Tr.UpstreamGenericName)
|
||||||
upstreamResetOptions := utils.ResolvePlaceholderString(
|
upstreamResetOptions := utils.ResolvePlaceholderString(
|
||||||
self.c.Tr.ViewUpstreamResetOptions,
|
self.c.Tr.ViewUpstreamResetOptions,
|
||||||
|
|
|
@ -65,10 +65,7 @@ var RebaseToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.ExpectPopup().Menu().
|
t.ExpectPopup().Menu().
|
||||||
Title(Equals("Upstream options")).
|
Title(Equals("Upstream options")).
|
||||||
/* EXPECTED:
|
|
||||||
Select(Contains("Rebase checked-out branch onto origin/master...")).
|
Select(Contains("Rebase checked-out branch onto origin/master...")).
|
||||||
ACTUAL: */
|
|
||||||
Select(Contains("Rebase checked-out branch onto origin/master-local...")).
|
|
||||||
Confirm()
|
Confirm()
|
||||||
t.ExpectPopup().Menu().
|
t.ExpectPopup().Menu().
|
||||||
Title(Equals("Rebase 'target'")).
|
Title(Equals("Rebase 'target'")).
|
||||||
|
|
|
@ -59,27 +59,14 @@ var ResetToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Tap(func() {
|
Tap(func() {
|
||||||
t.ExpectPopup().Menu().
|
t.ExpectPopup().Menu().
|
||||||
Title(Equals("Upstream options")).
|
Title(Equals("Upstream options")).
|
||||||
/* EXPECTED:
|
|
||||||
Select(Contains("Reset checked-out branch onto origin/soft-branch...")).
|
Select(Contains("Reset checked-out branch onto origin/soft-branch...")).
|
||||||
ACTUAL: */
|
|
||||||
Select(Contains("Reset checked-out branch onto origin/soft-branch-local...")).
|
|
||||||
Confirm()
|
Confirm()
|
||||||
|
|
||||||
t.ExpectPopup().Menu().
|
t.ExpectPopup().Menu().
|
||||||
/* EXPECTED:
|
|
||||||
Title(Equals("Reset to origin/soft-branch")).
|
Title(Equals("Reset to origin/soft-branch")).
|
||||||
ACTUAL: */
|
|
||||||
Title(Equals("Reset to origin/soft-branch-local")).
|
|
||||||
Select(Contains("Soft reset")).
|
Select(Contains("Soft reset")).
|
||||||
Confirm()
|
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(
|
t.Views().Commits().Lines(
|
||||||
Contains("soft commit"),
|
Contains("soft commit"),
|
||||||
Contains("hard commit"),
|
Contains("hard commit"),
|
||||||
|
@ -88,7 +75,6 @@ var ResetToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Contains("file-1").Contains("A"),
|
Contains("file-1").Contains("A"),
|
||||||
Contains("file-2").Contains("A"),
|
Contains("file-2").Contains("A"),
|
||||||
)
|
)
|
||||||
*/
|
|
||||||
|
|
||||||
// hard reset
|
// hard reset
|
||||||
t.Views().Branches().
|
t.Views().Branches().
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue