-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when viewing the divergence of a branch which is up to date…
… with its upstream (#3918) This was introduced by #3838, specifically by commit e675025. Fixes #3900 and #3917.
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
pkg/integration/tests/branch/show_divergence_from_upstream_no_divergence.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package branch | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var ShowDivergenceFromUpstreamNoDivergence = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Show divergence from upstream when the divergence view is empty", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("commit1") | ||
shell.CloneIntoRemote("origin") | ||
shell.SetBranchUpstream("master", "origin/master") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Branches(). | ||
Focus(). | ||
Lines(Contains("master")). | ||
Press(keys.Branches.SetUpstream) | ||
|
||
t.ExpectPopup().Menu().Title(Contains("Upstream")).Select(Contains("View divergence from upstream")).Confirm() | ||
|
||
t.Views().SubCommits(). | ||
IsFocused(). | ||
Title(Contains("Commits (master <-> origin/master)")). | ||
Lines( | ||
Contains("--- Remote ---"), | ||
Contains("--- Local ---"), | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters