summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_test.go
diff options
context:
space:
mode:
authorRyooooooga <ryoga_314@yahoo.co.jp>2021-03-02 13:36:04 +0900
committerJesse Duffield <jessedduffield@gmail.com>2021-03-13 11:02:31 +1100
commit3d698cd7c1a2e58ae9263addf57906ad9b349ecc (patch)
treecb762a0ec0c759b7f9b4cf80f0cfabe50bd1be46 /pkg/commands/git_test.go
parenta48cc245e711f144254b2bb13efe901cdfbd9059 (diff)
Fix tests
Diffstat (limited to 'pkg/commands/git_test.go')
-rw-r--r--pkg/commands/git_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go
index 75f189df8..1f290fbc0 100644
--- a/pkg/commands/git_test.go
+++ b/pkg/commands/git_test.go
@@ -1037,7 +1037,7 @@ func TestGitCommandStageFile(t *testing.T) {
gitCmd := NewDummyGitCommand()
gitCmd.OSCommand.Command = func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
- assert.EqualValues(t, []string{"add", "test.txt"}, args)
+ assert.EqualValues(t, []string{"add", "--", "test.txt"}, args)
return secureexec.Command("echo")
}
@@ -1059,7 +1059,7 @@ func TestGitCommandUnstageFile(t *testing.T) {
"Remove an untracked file from staging",
func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
- assert.EqualValues(t, []string{"rm", "--cached", "--force", "test.txt"}, args)
+ assert.EqualValues(t, []string{"rm", "--cached", "--force", "--", "test.txt"}, args)
return secureexec.Command("echo")
},
@@ -1072,7 +1072,7 @@ func TestGitCommandUnstageFile(t *testing.T) {
"Remove a tracked file from staging",
func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
- assert.EqualValues(t, []string{"reset", "HEAD", "test.txt"}, args)
+ assert.EqualValues(t, []string{"reset", "HEAD", "--", "test.txt"}, args)
return secureexec.Command("echo")
},
@@ -1455,7 +1455,7 @@ func TestGitCommandDiff(t *testing.T) {
"File not tracked and file has no staged changes",
func(cmd string, args ...string) *exec.Cmd {
assert.EqualValues(t, "git", cmd)
- assert.EqualValues(t, []string{"diff", "--submodule", "--no-ext-diff", "--color=always", "--no-index", "/dev/null", "test.txt"}, args)
+ assert.EqualValues(t, []string{"diff", "--submodule", "--no-ext-diff", "--color=always", "--no-index", "--", "/dev/null", "test.txt"}, args)
return secureexec.Command("echo")
},