summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e90fdc3)
raw | patch | inline | side by side (parent: e90fdc3)
author | Gabriel Filion <lelutin@gmail.com> | |
Wed, 17 Feb 2010 04:18:50 +0000 (23:18 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Feb 2010 18:55:12 +0000 (10:55 -0800) |
With NONGIT_OK set, require_work_tree function outside a git repository
gives a syntax error. This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.
Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gives a syntax error. This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.
Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.
Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-sh-setup.sh | patch | blob | history |
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 7bef43f39d0d74497104351d2f40258dfccce104..d2789410de3dc833cc7d3503ed9ea7d343d040ac 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
}
require_work_tree () {
- test $(git rev-parse --is-inside-work-tree) = true ||
+ test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
die "fatal: $0 cannot be used without a working tree."
}