summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Pascal Obry <pascal.obry@wanadoo.fr>2007-11-26 23:04:28 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-27 20:42:21 -0800
commitaa4f31d5a3923939bf2cb670ecaa4f68025f4bf3 (patch)
tree299a15ffc6a45c84403aa689689a1456da4dd332
parentUse is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c (diff)
downloadtgif-aa4f31d5a3923939bf2cb670ecaa4f68025f4bf3.tar.xz
git-stash: do not get fooled with "color.diff = true"
When colors are set to "true" on the repository, the git log output will contain control characters to set/reset the colors, even when the output is to a pipe. This makes list_stash() fail as the downstream sed does not see what it is expecting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-stash.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 534eb168ab..dd155568d9 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -37,7 +37,7 @@ create_stash () {
# state of the base commit
if b_commit=$(git rev-parse --verify HEAD)
then
- head=$(git log --abbrev-commit --pretty=oneline -n 1 HEAD)
+ head=$(git log --no-color --abbrev-commit --pretty=oneline -n 1 HEAD --)
else
die "You do not have the initial commit yet"
fi
@@ -108,7 +108,7 @@ have_stash () {
list_stash () {
have_stash || return 0
- git log --pretty=oneline -g "$@" $ref_stash |
+ git log --no-color --pretty=oneline -g "$@" $ref_stash -- |
sed -n -e 's/^[.0-9a-f]* refs\///p'
}