vscode-gitstash icon indicating copy to clipboard operation
vscode-gitstash copied to clipboard

"Stash selected files..." fails if selected files are not staged or if stash message is more than a single word

Open jolsen-mitsu opened this issue 8 months ago • 0 comments

The "Stash selected files..." fails with did not match any file(s) known to git error messages if the selected file(s) are not also staged. Adding the -u parameter will allow git to stash unstaged selected files, too.

It also looks like the stash message is not quoted, which causes issues if the stash message is more than a single word. The parameter should be quoted (with any quotes within the message escaped with a backslash) to prevent this error. Example of quoted string with internal quotes escaped: "This is \"the\" way to do it"

Change the current command being executed from: git stash push -m MESSAGEHERE -- PATHSHERE to: git stash push -m "QUOTEESCAPEDMESSAGEHERE" -u -- PATHSHERE

jolsen-mitsu avatar Jun 20 '24 14:06 jolsen-mitsu