fix documentation for git-commit --no-verify
[gitweb.git] / git-sh-setup.sh
index 42f9b1c125578a7158392b53ec8792d6c6bbb273..4a02b3825ecc15cb289a1dadb328e39a1869f3f1 100755 (executable)
@@ -20,6 +20,27 @@ usage() {
        die "Usage: $0 $USAGE"
 }
 
+set_reflog_action() {
+       if [ -z "${GIT_REFLOG_ACTION:+set}" ]
+       then
+               GIT_REFLOG_ACTION="$*"
+               export GIT_REFLOG_ACTION
+       fi
+}
+
+is_bare_repository () {
+       git-repo-config --bool --get core.bare ||
+       case "$GIT_DIR" in
+       .git | */.git) echo false ;;
+       *) echo true ;;
+       esac
+}
+
+require_work_tree () {
+       test $(is_bare_repository) = false ||
+       die "fatal: $0 cannot be used without a working tree."
+}
+
 if [ -z "$LONG_USAGE" ]
 then
        LONG_USAGE="Usage: $0 $USAGE"