2005-07-08 17:57:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Set up GIT_DIR and GIT_OBJECT_DIRECTORY
|
|
|
|
# and return true if everything looks ok
|
|
|
|
#
|
|
|
|
: ${GIT_DIR=.git}
|
|
|
|
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
|
|
|
|
|
2005-09-13 02:47:07 +00: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-07-08 17:57:21 +00:00
|
|
|
die() {
|
2005-09-30 21:26:57 +00:00
|
|
|
echo >&2 "$@"
|
2005-07-08 17:57:21 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2005-09-30 21:26:57 +00:00
|
|
|
case "$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD 2>/dev/null)" in
|
|
|
|
refs/*) : ;;
|
|
|
|
*) false ;;
|
|
|
|
esac &&
|
2005-08-06 17:04:50 +00:00
|
|
|
[ -d "$GIT_DIR/refs" ] &&
|
2005-07-08 17:57:21 +00:00
|
|
|
[ -d "$GIT_OBJECT_DIRECTORY/00" ]
|