]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-instaweb.sh
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
[git.git] / git-instaweb.sh
index cbc7418e3501b37a701a5177157733d97b405376..41ff08f8e44b12bddcea257bc66f0b577e342ddd 100755 (executable)
@@ -8,13 +8,7 @@ USAGE='[--start] [--stop] [--restart]
 
 . git-sh-setup
 
-case "$GIT_DIR" in
-/*)
-       fqgitdir="$GIT_DIR" ;;
-*)
-       fqgitdir="$PWD/$GIT_DIR" ;;
-esac
-
+fqgitdir="$GIT_DIR"
 local="`git config --bool --get instaweb.local`"
 httpd="`git config --get instaweb.httpd`"
 browser="`git config --get instaweb.browser`"
@@ -36,8 +30,7 @@ test -z "$port" && port=1234
 
 start_httpd () {
        httpd_only="`echo $httpd | cut -f1 -d' '`"
-       if test "`expr index $httpd_only /`" -eq '1' || \
-                               which $httpd_only >/dev/null
+       if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
        then
                $httpd $fqgitdir/gitweb/httpd.conf
        else
@@ -67,7 +60,7 @@ stop_httpd () {
        test -f "$fqgitdir/pid" && kill `cat "$fqgitdir/pid"`
 }
 
-while case "$#" in 0) break ;; esac
+while test $# != 0
 do
        case "$1" in
        --stop|stop)