Skip to content

Commit 7b556aa

Browse files
dschogitster
authored andcommitted
legacy stash: fix "rudimentary backport of -q"
When this developer backported support for `--quiet` to the scripted version of `git stash` in 8059005 (stash: optionally use the scripted version again, 2018-12-20), it looked like a sane choice to use `eval` to execute the command line passed in via the parameter list of `maybe_quiet`. However, that is not what we should have done, as that command-line was already in the correct shape. This can be seen very clearly when passing arguments with special characters, like git stash -- ':(glob)**/*.txt' Since this is exactly what we want to test in the next commit (where we fix this very incantation with the built-in stash), let's fix the legacy scripted version of `git stash` first. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7906af0 commit 7b556aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git-legacy-stash.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ maybe_quiet () {
8686
shift
8787
if test -n "$GIT_QUIET"
8888
then
89-
eval "$@" 2>/dev/null
89+
"$@" 2>/dev/null
9090
else
91-
eval "$@"
91+
"$@"
9292
fi
9393
;;
9494
*)
9595
if test -n "$GIT_QUIET"
9696
then
97-
eval "$@" >/dev/null 2>&1
97+
"$@" >/dev/null 2>&1
9898
else
99-
eval "$@"
99+
"$@"
100100
fi
101101
;;
102102
esac

0 commit comments

Comments
 (0)