git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] stash: fix incorrect quoting in cleanup of temporary files

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 16, 2011, 08:14 UTC
Message-ID
<4D807169.5070804@viscovery.net>
In-Reply-To
<4D8070E1.8000305@viscovery.net>
From: Johannes Sixt <j6t@kdbg.org>

The * was inside the quotes, so that the pattern was never expanded and the temporary files were never removed. As a consequence, 'stash -p' left a .git-stash-*-patch file in $GIT_DIR. Other code paths did not leave files behind because they removed the temporary file themselves, at least in non-error paths.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 git-stash.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index 7561b37..7c0d563 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -17,7 +17,7 @@ require_work_tree
 cd_to_toplevel
 
 TMP="$GIT_DIR/.git-stash.$$"
-trap 'rm -f "$TMP-*"' 0
+trap 'rm -f "$TMP-"*' 0
 
 ref_stash=refs/stash
 
-- 
1.7.4.1.316.g2ab2cb
Previous: Johannes SixtNext: Johannes Sixt
Message 8 of 9 in “[RFD] git stash over OpenBSD/Linux NFS - cp -p breakage”
  1. Jakob PfenderMar 15, 2011
  2. Johannes SixtMar 15, 2011
  3. Jakob PfenderMar 15, 2011
  4. stash: copy the index using --index-output instead of cp -pJohannes Sixt, Mar 15, 2011
  5. Junio C HamanoMar 15, 2011
  6. Bert WesargMar 15, 2011
  7. Johannes SixtMar 16, 2011
  8. 1/2 stash: fix incorrect quoting in cleanup of temporary filesJohannes Sixt, Mar 16, 2011
  9. 2/2 stash: copy the index using --index-output instead of cp -pJohannes Sixt, Mar 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.