summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1cf716a)
raw | patch | inline | side by side (parent: 1cf716a)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 12 Jan 2007 20:24:16 +0000 (12:24 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 12 Jan 2007 20:26:39 +0000 (12:26 -0800) |
Andy Parkins noticed that the error message some "whole tree"
oriented commands emit is stated misleadingly when they refused
to run from a subdirectory.
We could probably allow some of them to work from a subdirectory
but that is a semantic change that could have unintended side
effects, so let's start at first by rewording the error message
to be easier to read without doing anything else to be safe.
Signed-off-by: Junio C Hamano <junkio@cox.net>
oriented commands emit is stated misleadingly when they refused
to run from a subdirectory.
We could probably allow some of them to work from a subdirectory
but that is a semantic change that could have unintended side
effects, so let's start at first by rewording the error message
to be easier to read without doing anything else to be safe.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-sh-setup.sh | patch | blob | history |
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 4a02b3825ecc15cb289a1dadb328e39a1869f3f1..57f7f7777602eadc79b6bb04e6652d81d14d770c 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
if [ -z "$SUBDIRECTORY_OK" ]
then
: ${GIT_DIR=.git}
- GIT_DIR=$(GIT_DIR="$GIT_DIR" git-rev-parse --git-dir) || exit
+ GIT_DIR=$(GIT_DIR="$GIT_DIR" git-rev-parse --git-dir) || {
+ exit=$?
+ echo >&2 "You need to run this command from the toplevel of the working tree."
+ exit $exit
+ }
else
GIT_DIR=$(git-rev-parse --git-dir) || exit
fi