mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
Fixed tests
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
This commit is contained in:
parent
b74107f2ba
commit
d9eb6e2682
2 changed files with 5 additions and 6 deletions
|
@ -288,7 +288,6 @@ func (c *CommitListBuilder) getLog(limit bool) string {
|
||||||
limitFlag = "-30"
|
limitFlag = "-30"
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Log.Warn(fmt.Sprintf("git log --oneline %s --abbrev=%d", limitFlag, 20))
|
|
||||||
result, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("git log --oneline %s --abbrev=%d", limitFlag, 20))
|
result, err := c.OSCommand.RunCommandWithOutput(fmt.Sprintf("git log --oneline %s --abbrev=%d", limitFlag, 20))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// assume if there is an error there are no commits yet for this branch
|
// assume if there is an error there are no commits yet for this branch
|
||||||
|
|
|
@ -163,7 +163,7 @@ func TestCommitListBuilderGetLog(t *testing.T) {
|
||||||
"Retrieves logs",
|
"Retrieves logs",
|
||||||
func(cmd string, args ...string) *exec.Cmd {
|
func(cmd string, args ...string) *exec.Cmd {
|
||||||
assert.EqualValues(t, "git", cmd)
|
assert.EqualValues(t, "git", cmd)
|
||||||
assert.EqualValues(t, []string{"log", "--oneline", "-30"}, args)
|
assert.EqualValues(t, []string{"log", "--oneline", "-30", "--abbrev=20"}, args)
|
||||||
|
|
||||||
return exec.Command("echo", "6f0b32f commands/git : add GetCommits tests refactor\n9d9d775 circle : remove new line")
|
return exec.Command("echo", "6f0b32f commands/git : add GetCommits tests refactor\n9d9d775 circle : remove new line")
|
||||||
},
|
},
|
||||||
|
@ -175,7 +175,7 @@ func TestCommitListBuilderGetLog(t *testing.T) {
|
||||||
"An error occurred when retrieving logs",
|
"An error occurred when retrieving logs",
|
||||||
func(cmd string, args ...string) *exec.Cmd {
|
func(cmd string, args ...string) *exec.Cmd {
|
||||||
assert.EqualValues(t, "git", cmd)
|
assert.EqualValues(t, "git", cmd)
|
||||||
assert.EqualValues(t, []string{"log", "--oneline", "-30"}, args)
|
assert.EqualValues(t, []string{"log", "--oneline", "-30", "--abbrev=20"}, args)
|
||||||
return exec.Command("test")
|
return exec.Command("test")
|
||||||
},
|
},
|
||||||
func(output string) {
|
func(output string) {
|
||||||
|
@ -212,7 +212,7 @@ func TestCommitListBuilderGetCommits(t *testing.T) {
|
||||||
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
||||||
return exec.Command("echo")
|
return exec.Command("echo")
|
||||||
case "log":
|
case "log":
|
||||||
assert.EqualValues(t, []string{"log", "--oneline", "-30"}, args)
|
assert.EqualValues(t, []string{"log", "--oneline", "-30", "--abbrev=20"}, args)
|
||||||
return exec.Command("echo")
|
return exec.Command("echo")
|
||||||
case "merge-base":
|
case "merge-base":
|
||||||
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
||||||
|
@ -239,7 +239,7 @@ func TestCommitListBuilderGetCommits(t *testing.T) {
|
||||||
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
||||||
return exec.Command("echo", "8a2bb0e")
|
return exec.Command("echo", "8a2bb0e")
|
||||||
case "log":
|
case "log":
|
||||||
assert.EqualValues(t, []string{"log", "--oneline", "-30"}, args)
|
assert.EqualValues(t, []string{"log", "--oneline", "-30", "--abbrev=20"}, args)
|
||||||
return exec.Command("echo", "8a2bb0e commit 1\n78976bc commit 2")
|
return exec.Command("echo", "8a2bb0e commit 1\n78976bc commit 2")
|
||||||
case "merge-base":
|
case "merge-base":
|
||||||
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
||||||
|
@ -280,7 +280,7 @@ func TestCommitListBuilderGetCommits(t *testing.T) {
|
||||||
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
assert.EqualValues(t, []string{"rev-list", "@{u}..HEAD", "--abbrev-commit"}, args)
|
||||||
return exec.Command("echo", "8a2bb0e")
|
return exec.Command("echo", "8a2bb0e")
|
||||||
case "log":
|
case "log":
|
||||||
assert.EqualValues(t, []string{"log", "--oneline", "-30"}, args)
|
assert.EqualValues(t, []string{"log", "--oneline", "-30", "--abbrev=20"}, args)
|
||||||
return exec.Command("echo", "8a2bb0e commit 1\n78976bc commit 2")
|
return exec.Command("echo", "8a2bb0e commit 1\n78976bc commit 2")
|
||||||
case "merge-base":
|
case "merge-base":
|
||||||
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
assert.EqualValues(t, []string{"merge-base", "HEAD", "master"}, args)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue