aboutsummaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-12 12:24:16 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-12 12:26:39 -0800
commit120b0dfbed148461c4e1349d12a1b7913545260e (patch)
tree218426a091d4a92ff33675a61e66da7d7741a0cf /git-sh-setup.sh
parent1cf716a21901e0e91db0510d18b212f34cea9e41 (diff)
downloadgit-120b0dfbed148461c4e1349d12a1b7913545260e.tar.gz
git-120b0dfbed148461c4e1349d12a1b7913545260e.tar.xz
Explain "Not a git repository: '.git'".
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>
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 4a02b3825..57f7f7777 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -60,7 +60,11 @@ esac
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