summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/stash_test.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-07-01 16:18:38 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-07-10 15:09:17 +0200
commit1827380c69f00288fe3c8e6dfb91775c6be4ffa9 (patch)
tree22e5273837af7f60187b676f867daac275c413c9 /pkg/commands/git_commands/stash_test.go
parentea0baf58e6b4b819117a859e06e82c3cef1aaf0d (diff)
Fix git stash calls for older git versions
Older git versions are pickier about parameter order: for "store", the sha argument must come last, and for "save", the message must come last.
Diffstat (limited to 'pkg/commands/git_commands/stash_test.go')
-rw-r--r--pkg/commands/git_commands/stash_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/stash_test.go b/pkg/commands/git_commands/stash_test.go
index d19c0a519..f1a151cd8 100644
--- a/pkg/commands/git_commands/stash_test.go
+++ b/pkg/commands/git_commands/stash_test.go
@@ -57,7 +57,7 @@ func TestStashStore(t *testing.T) {
testName: "Non-empty message",
sha: "0123456789abcdef",
message: "New stash name",
- expected: []string{"stash", "store", "0123456789abcdef", "-m", "New stash name"},
+ expected: []string{"stash", "store", "-m", "New stash name", "0123456789abcdef"},
},
{
testName: "Empty message",
@@ -162,7 +162,7 @@ func TestStashRename(t *testing.T) {
expectedShaCmd: []string{"rev-parse", "refs/stash@{3}"},
shaResult: "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd\n",
expectedDropCmd: []string{"stash", "drop", "stash@{3}"},
- expectedStoreCmd: []string{"stash", "store", "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd", "-m", "New message"},
+ expectedStoreCmd: []string{"stash", "store", "-m", "New message", "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd"},
},
{
testName: "Empty message",