@@ -10,7 +10,7 @@ import (
1010
1111func TestStashDrop (t * testing.T ) {
1212 runner := oscommands .NewFakeRunner (t ).
13- ExpectGitArgs ([]string {"stash" , "drop" , "stash@{1}" }, "Dropped refs/stash@{1} (98e9cca532c37c766107093010c72e26f2c24c04)\n " , nil )
13+ ExpectGitArgs ([]string {"stash" , "drop" , "refs/ stash@{1}" }, "Dropped refs/stash@{1} (98e9cca532c37c766107093010c72e26f2c24c04)\n " , nil )
1414 instance := buildStashCommands (commonDeps {runner : runner })
1515
1616 assert .NoError (t , instance .Drop (1 ))
@@ -19,7 +19,7 @@ func TestStashDrop(t *testing.T) {
1919
2020func TestStashApply (t * testing.T ) {
2121 runner := oscommands .NewFakeRunner (t ).
22- ExpectGitArgs ([]string {"stash" , "apply" , "stash@{1}" }, "" , nil )
22+ ExpectGitArgs ([]string {"stash" , "apply" , "refs/ stash@{1}" }, "" , nil )
2323 instance := buildStashCommands (commonDeps {runner : runner })
2424
2525 assert .NoError (t , instance .Apply (1 ))
@@ -28,7 +28,7 @@ func TestStashApply(t *testing.T) {
2828
2929func TestStashPop (t * testing.T ) {
3030 runner := oscommands .NewFakeRunner (t ).
31- ExpectGitArgs ([]string {"stash" , "pop" , "stash@{1}" }, "" , nil )
31+ ExpectGitArgs ([]string {"stash" , "pop" , "refs/ stash@{1}" }, "" , nil )
3232 instance := buildStashCommands (commonDeps {runner : runner })
3333
3434 assert .NoError (t , instance .Pop (1 ))
@@ -113,31 +113,31 @@ func TestStashStashEntryCmdObj(t *testing.T) {
113113 contextSize : 3 ,
114114 similarityThreshold : 50 ,
115115 ignoreWhitespace : false ,
116- expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--find-renames=50%" , "stash@{5}" },
116+ expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--find-renames=50%" , "refs/ stash@{5}" },
117117 },
118118 {
119119 testName : "Show diff with custom context size" ,
120120 index : 5 ,
121121 contextSize : 77 ,
122122 similarityThreshold : 50 ,
123123 ignoreWhitespace : false ,
124- expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=77" , "--find-renames=50%" , "stash@{5}" },
124+ expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=77" , "--find-renames=50%" , "refs/ stash@{5}" },
125125 },
126126 {
127127 testName : "Show diff with custom similarity threshold" ,
128128 index : 5 ,
129129 contextSize : 3 ,
130130 similarityThreshold : 33 ,
131131 ignoreWhitespace : false ,
132- expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--find-renames=33%" , "stash@{5}" },
132+ expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--find-renames=33%" , "refs/ stash@{5}" },
133133 },
134134 {
135135 testName : "Default case" ,
136136 index : 5 ,
137137 contextSize : 3 ,
138138 similarityThreshold : 50 ,
139139 ignoreWhitespace : true ,
140- expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--ignore-all-space" , "--find-renames=50%" , "stash@{5}" },
140+ expected : []string {"git" , "-C" , "/path/to/worktree" , "stash" , "show" , "-p" , "--stat" , "-u" , "--color=always" , "--unified=3" , "--ignore-all-space" , "--find-renames=50%" , "refs/ stash@{5}" },
141141 },
142142 }
143143
@@ -177,7 +177,7 @@ func TestStashRename(t *testing.T) {
177177 message : "New message" ,
178178 expectedHashCmd : []string {"rev-parse" , "refs/stash@{3}" },
179179 hashResult : "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd\n " ,
180- expectedDropCmd : []string {"stash" , "drop" , "stash@{3}" },
180+ expectedDropCmd : []string {"stash" , "drop" , "refs/ stash@{3}" },
181181 expectedStoreCmd : []string {"stash" , "store" , "-m" , "New message" , "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd" },
182182 },
183183 {
@@ -186,7 +186,7 @@ func TestStashRename(t *testing.T) {
186186 message : "" ,
187187 expectedHashCmd : []string {"rev-parse" , "refs/stash@{4}" },
188188 hashResult : "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd\n " ,
189- expectedDropCmd : []string {"stash" , "drop" , "stash@{4}" },
189+ expectedDropCmd : []string {"stash" , "drop" , "refs/ stash@{4}" },
190190 expectedStoreCmd : []string {"stash" , "store" , "f0d0f20f2f61ffd6d6bfe0752deffa38845a3edd" },
191191 },
192192 }
0 commit comments