[RFC/PATCH v2 7/8] rebase: cherry-pick: automatically commit stage
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 29, 2013, 04:16 UTC
- Message-ID
- <1369801000-3705-8-git-send-email-felipe.contreras@gmail.com>
- In-Reply-To
- <1369801000-3705-1-git-send-email-felipe.contreras@gmail.com>
When there's changes in the staging area. Just like the other rebase modes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- git-rebase--cherrypick.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh index ef3224d..0fcf2e1 100644 --- a/git-rebase--cherrypick.sh +++ b/git-rebase--cherrypick.sh @@ -8,6 +8,12 @@ export GIT_CHERRY_PICK_HELP case "$action" in continue) + # do we have anything to commit? + if ! git diff-index --cached --quiet HEAD -- + then + git commit --no-verify -e || + die "Could not commit staged changes." + fi git cherry-pick --continue && move_to_original_branch && rm -rf "$state_dir"
-- 1.8.3.rc3.312.g47657de