push: teach --force-with-lease to smart-http transport
[gitweb.git] / git-rebase--merge.sh
index 26afc75cc7d0fbf3de69325043130836c32454a0..16d18176ece5eecf4a3b0b0a9dea0a5b41ac43d4 100644 (file)
@@ -3,8 +3,6 @@
 # Copyright (c) 2010 Junio C Hamano.
 #
 
-. git-sh-setup
-
 prec=4
 
 read_state () {
@@ -90,12 +88,14 @@ call_merge () {
 
 finish_rb_merge () {
        move_to_original_branch
-       git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
-       if test -x "$GIT_DIR"/hooks/post-rewrite &&
-               test -s "$state_dir"/rewritten; then
-               "$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
+       if test -s "$state_dir"/rewritten
+       then
+               git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
+               if test -x "$GIT_DIR"/hooks/post-rewrite
+               then
+                       "$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
+               fi
        fi
-       rm -r "$state_dir"
        say All done.
 }
 
@@ -109,7 +109,7 @@ continue)
                continue_merge
        done
        finish_rb_merge
-       exit
+       return
        ;;
 skip)
        read_state
@@ -121,7 +121,7 @@ skip)
                continue_merge
        done
        finish_rb_merge
-       exit
+       return
        ;;
 esac