artrz / vscode-gitstash

Adds extra Git stash powers to VS Code
https://marketplace.visualstudio.com/items?itemName=arturock.gitstash
MIT License
24 stars 4 forks source link

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

Open jolsen-mitsu opened 2 months ago

jolsen-mitsu commented 2 months ago

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