diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 8cbd153b62265b8fbbd2dd73fc4089fa26dbc669..185c5c6c95df389e0d7f39f47feeabbe67124e80 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
exit $exit
}
else
- GIT_DIR=$(git rev-parse --git-dir) || exit
+ GIT_DIR=$(git rev-parse --git-dir) || {
+ exit=$?
+ echo >&2 "Failed to find a valid git directory."
+ exit $exit
+ }
fi
+
+test -n "$GIT_DIR" && GIT_DIR=$(cd "$GIT_DIR" && pwd) || {
+ echo >&2 "Unable to determine absolute path of git directory"
+ exit 1
+}
+
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}