Skip to content

Commit

Permalink
Explain "Not a git repository: '.git'".
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jan 12, 2007
1 parent 1cf716a commit 120b0df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 120b0df

Please sign in to comment.