@matheusbsbs / matheus-bagliano / commits / 120b0dfbed
Fork 0

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>

Junio C Hamano committed Jan 12, 2007 at 12:24 UTC 120b0dfbed148461c4e1349d12a1b7913545260e
1 file changed +5 -1
git-sh-setup.sh
+5 -1
@@ -60,7 +60,11 @@ esac
60 if [ -z "$SUBDIRECTORY_OK" ]
61 then
62 : ${GIT_DIR=.git}
63 - GIT_DIR=$(GIT_DIR="$GIT_DIR" git-rev-parse --git-dir) || exit
63 + GIT_DIR=$(GIT_DIR="$GIT_DIR" git-rev-parse --git-dir) || {
64 + exit=$?
65 + echo >&2 "You need to run this command from the toplevel of the working tree."
66 + exit $exit
67 + }
68 else
69 GIT_DIR=$(git-rev-parse --git-dir) || exit
70 fi