1 # This shell script fragment is sourced by git-rebase to implement
2 # its default, fast, patch-based, non-interactive mode.
4 # Copyright (c) 2010 Junio C Hamano.
9 git am --resolved --resolvemsg="$resolvemsg" \
10 ${gpg_sign_opt:+"$gpg_sign_opt"} &&
11 move_to_original_branch
15 git am --skip --resolvemsg="$resolvemsg" &&
16 move_to_original_branch
21 test -n "$rebase_root" && root_flag=--root
24 if test -n "$keep_empty"
26 # we have to do this the hard way. git format-patch completely squashes
27 # empty commits and even if it didn't the format doesn't really lend
28 # itself well to recording empty patches. fortunately, cherry-pick
30 git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty "$revisions"
33 rm -f "$GIT_DIR/rebased-patches"
35 git format-patch -k --stdout --full-index --ignore-if-in-upstream \
36 --src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
37 $root_flag "$revisions" >"$GIT_DIR/rebased-patches"
42 rm -f "$GIT_DIR/rebased-patches"
45 git checkout -q "$head_name"
48 git checkout -q "$orig_head"
54 git encountered an error while preparing the patches to replay
59 As a result, git cannot rebase them.
64 git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
65 ${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
68 rm -f "$GIT_DIR/rebased-patches"
73 test -d "$state_dir" && write_basic_state
77 move_to_original_branch