Fix adding a submodule with a remote url
[gitweb.git] / git-merge.sh
index 3a01db0d751e272541efd0f27177a9ca5cb63bbe..6c513dcbdf44036b0207c276e765a87eceb7aa77 100755 (executable)
@@ -97,6 +97,19 @@ finish () {
                fi
                ;;
        esac
+
+       # Run a post-merge hook
+        if test -x "$GIT_DIR"/hooks/post-merge
+        then
+           case "$squash" in
+           t)
+                "$GIT_DIR"/hooks/post-merge 1
+               ;;
+           '')
+                "$GIT_DIR"/hooks/post-merge 0
+               ;;
+           esac
+        fi
 }
 
 merge_name () {
@@ -122,7 +135,7 @@ merge_name () {
 case "$#" in 0) usage ;; esac
 
 have_message=
-while case "$#" in 0) break ;; esac
+while test $# != 0
 do
        case "$1" in
        -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\