38
fi
39
40
ret=0
41
-if test -n "$keep_empty"
42
-then
43
- # we have to do this the hard way. git format-patch completely squashes
44
- # empty commits and even if it didn't the format doesn't really lend
45
- # itself well to recording empty patches. fortunately, cherry-pick
46
- # makes this easy
47
- git cherry-pick ${gpg_sign_opt:+"$gpg_sign_opt"} --allow-empty \
48
- $allow_rerere_autoupdate --right-only "$revisions" \
49
- ${restrict_revision+^$restrict_revision}
50
- ret=$?
51
-else
52
- rm -f "$GIT_DIR/rebased-patches"
41
+rm -f "$GIT_DIR/rebased-patches"
42
54
- git format-patch -k --stdout --full-index --cherry-pick --right-only \
55
- --src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
56
- --pretty=mboxrd \
57
- $git_format_patch_opt \
58
- "$revisions" ${restrict_revision+^$restrict_revision} \
59
- >"$GIT_DIR/rebased-patches"
60
- ret=$?
43
+git format-patch -k --stdout --full-index --cherry-pick --right-only \
44
+ --src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
45
+ --pretty=mboxrd \
46
+ $git_format_patch_opt \
47
+ "$revisions" ${restrict_revision+^$restrict_revision} \
48
+ >"$GIT_DIR/rebased-patches"
49
+ret=$?
50
62
- if test 0 != $ret
63
- then
64
- rm -f "$GIT_DIR/rebased-patches"
65
- case "$head_name" in
66
- refs/heads/*)
67
- git checkout -q "$head_name"
68
- ;;
69
- *)
70
- git checkout -q "$orig_head"
71
- ;;
72
- esac
51
+if test 0 != $ret
52
+then
53
+ rm -f "$GIT_DIR/rebased-patches"
54
+ case "$head_name" in
55
+ refs/heads/*)
56
+ git checkout -q "$head_name"
57
+ ;;
58
+ *)
59
+ git checkout -q "$orig_head"
60
+ ;;
61
+ esac
62
74
- cat >&2 <<-EOF
63
+ cat >&2 <<-EOF
64
76
- git encountered an error while preparing the patches to replay
77
- these revisions:
65
+ git encountered an error while preparing the patches to replay
66
+ these revisions:
67
79
- $revisions
68
+ $revisions
69
81
- As a result, git cannot rebase them.
82
- EOF
83
- return $ret
84
- fi
70
+ As a result, git cannot rebase them.
71
+ EOF
72
+ return $ret
73
+fi
74
86
- git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
87
- --patch-format=mboxrd \
88
- $allow_rerere_autoupdate \
89
- ${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
90
- ret=$?
75
+git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" \
76
+ --patch-format=mboxrd \
77
+ $allow_rerere_autoupdate \
78
+ ${gpg_sign_opt:+"$gpg_sign_opt"} <"$GIT_DIR/rebased-patches"
79
+ret=$?
80
92
- rm -f "$GIT_DIR/rebased-patches"
93
-fi
81
+rm -f "$GIT_DIR/rebased-patches"
82
83
if test 0 != $ret
84
then