2005-07-08 19:57:21 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2005-11-24 09:12:11 +01:00
|
|
|
# This is included in commands that either have to be run from the toplevel
|
|
|
|
# of the repository, or with GIT_DIR environment variable properly.
|
|
|
|
# If the GIT_DIR does not look like the right correct git-repository,
|
|
|
|
# it dies.
|
2005-07-08 19:57:21 +02:00
|
|
|
|
2005-09-13 04:47:07 +02:00
|
|
|
# Having this variable in your environment would break scripts because
|
|
|
|
# you would cause "cd" to be be taken to unexpected places. If you
|
|
|
|
# like CDPATH, define it for your interactive shell sessions without
|
|
|
|
# exporting it.
|
|
|
|
unset CDPATH
|
|
|
|
|
2005-11-24 09:12:11 +01:00
|
|
|
: ${GIT_DIR=.git}
|
|
|
|
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
|
|
|
|
|
2005-07-08 19:57:21 +02:00
|
|
|
die() {
|
2005-09-30 23:26:57 +02:00
|
|
|
echo >&2 "$@"
|
2005-07-08 19:57:21 +02:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2005-11-26 00:52:57 +01:00
|
|
|
# Make sure we are in a valid repository of a vintage we understand.
|
|
|
|
GIT_DIR="$GIT_DIR" git-var GIT_AUTHOR_IDENT >/dev/null || exit
|