3 # Copyright (c) 2014 Felipe Contreras
6 GIT_CHERRY_PICK_HELP="$resolvemsg"
7 export GIT_CHERRY_PICK_HELP
11 # do we have anything to commit?
12 if ! git diff-index --cached --quiet HEAD --
14 git commit --no-verify -e ||
15 die "Could not commit staged changes."
17 git cherry-pick --continue &&
18 move_to_original_branch
22 git cherry-pick --skip &&
23 move_to_original_branch
28 mkdir -p "$state_dir" || die "Could not create temporary $state_dir"
29 : > "$state_dir"/cherrypick || die "Could not mark as cherrypick"
31 if test -n "$rebase_root"
33 revisions="$onto...$orig_head"
35 revisions="$upstream...$orig_head"
38 if test -n "$keep_empty"
42 extra="--skip-empty --cherry-pick"
44 test -n "$GIT_QUIET" && extra="$extra -q"
45 test -z "$force_rebase" && extra="$extra --ff"
46 test -n "$strategy" && extra="$extra --strategy=$strategy"
47 for x in "$strategy_opts"
49 test -z "$x" && continue
51 extra="$extra -X${x#--}"
53 test -n "$allow_rerere_autoupdate" && extra="$extra $allow_rerere_autoupdate"
55 git cherry-pick --no-merges --right-only --topo-order --do-walk --action-name rebase $extra "$revisions"
64 move_to_original_branch