]> git.ipfire.org Git - thirdparty/git.git/blame - git-rebase--am.sh
wildmatch: rename constants and update prototype
[thirdparty/git.git] / git-rebase--am.sh
CommitLineData
46df82d5
MZ
1#!/bin/sh
2#
3# Copyright (c) 2010 Junio C Hamano.
4#
5
6. git-sh-setup
7
8case "$action" in
9continue)
c5e610be 10 git am --resolved --resolvemsg="$resolvemsg" &&
46df82d5
MZ
11 move_to_original_branch
12 exit
13 ;;
14skip)
c5e610be 15 git am --skip --resolvemsg="$resolvemsg" &&
46df82d5
MZ
16 move_to_original_branch
17 exit
18 ;;
19esac
20
21test -n "$rebase_root" && root_flag=--root
22
90e1818f
NH
23if test -n "$keep_empty"
24then
25 # we have to do this the hard way. git format-patch completely squashes
26 # empty commits and even if it didn't the format doesn't really lend
27 # itself well to recording empty patches. fortunately, cherry-pick
28 # makes this easy
29 git cherry-pick --allow-empty "$revisions"
30else
31 git format-patch -k --stdout --full-index --ignore-if-in-upstream \
32 --src-prefix=a/ --dst-prefix=b/ \
33 --no-renames $root_flag "$revisions" |
34 git am $git_am_opt --rebasing --resolvemsg="$resolvemsg"
35fi && move_to_original_branch
36
46df82d5 37ret=$?
84df4560 38test 0 != $ret -a -d "$state_dir" && write_basic_state
46df82d5 39exit $ret