Skip to content

Commit 12065f6

Browse files
committed
cmd/git(fix[stash.pop]): Use stash@{N} format instead of pathspec separator
why: The pop() method used ["--", str(stash)] which git interprets as a pathspec, not a stash reference. This caused all stash parameter values to fail with "is not a valid reference" errors. what: - Format stash parameter as stash@{N} without -- separator
1 parent 4d2d4f8 commit 12065f6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/libvcs/cmd/git.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4903,19 +4903,17 @@ def pop(
49034903
'No local changes to save'
49044904
"""
49054905
local_flags: list[str] = []
4906-
stash_flags: list[str] = []
4907-
4908-
if stash is not None:
4909-
stash_flags.extend(["--", str(stash)])
49104906

49114907
if index is True:
49124908
local_flags.append("--index")
49134909
if quiet is True:
49144910
local_flags.append("--quiet")
4911+
if stash is not None:
4912+
local_flags.append(f"stash@{{{stash}}}")
49154913

49164914
return self.run(
49174915
"pop",
4918-
local_flags=local_flags + stash_flags,
4916+
local_flags=local_flags,
49194917
check_returncode=check_returncode,
49204918
log_in_real_time=log_in_real_time,
49214919
)

0 commit comments

Comments
 (0)