cache_tree_find(): fix comment formatting
[gitweb.git] / git-sh-setup.sh
index 2f7835941ecaa48be17b6dd64e64fb0df3db37e2..e15be516369e5e5a9096bb957966938e134e616c 100644 (file)
@@ -53,7 +53,7 @@ die () {
 die_with_status () {
        status=$1
        shift
-       echo >&2 "$*"
+       printf >&2 '%s\n' "$*"
        exit "$status"
 }
 
@@ -313,3 +313,15 @@ then
        }
        : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
 fi
+
+peel_committish () {
+       case "$1" in
+       :/*)
+               peeltmp=$(git rev-parse --verify "$1") &&
+               git rev-parse --verify "${peeltmp}^0"
+               ;;
+       *)
+               git rev-parse --verify "${1}^0"
+               ;;
+       esac
+}