gitweb: Convert project name to UTF-8
[gitweb.git] / git-sh-setup.sh
index 57f7f7777602eadc79b6bb04e6652d81d14d770c..b4aa4b2f4e6b53388ea9ec0ac13316ae0d0d4458 100755 (executable)
@@ -29,13 +29,24 @@ set_reflog_action() {
 }
 
 is_bare_repository () {
-       git-repo-config --bool --get core.bare ||
+       git-config --bool --get core.bare ||
        case "$GIT_DIR" in
        .git | */.git) echo false ;;
        *) echo true ;;
        esac
 }
 
+cd_to_toplevel () {
+       cdup=$(git-rev-parse --show-cdup)
+       if test ! -z "$cdup"
+       then
+               cd "$cdup" || {
+                       echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree"
+                       exit 1
+               }
+       fi
+}
+
 require_work_tree () {
        test $(is_bare_repository) = false ||
        die "fatal: $0 cannot be used without a working tree."