diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-29 11:18:31 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-29 11:18:31 -0800 |
commit | da2987d4c3be50bb9d888d145ba42fe26c7045f3 (patch) | |
tree | f1385e81d0123482445f5f59ae498b703f253215 /git-rebase--interactive.sh | |
parent | 33b29fd12c04fb599ff3d2a3235bb187710a9080 (diff) | |
parent | 986977847e6fb46448fc9c567292ccd2a93d40b3 (diff) | |
download | git-da2987d4c3be50bb9d888d145ba42fe26c7045f3.tar.gz git-da2987d4c3be50bb9d888d145ba42fe26c7045f3.tar.xz |
Merge branch 'ph/rebase-preserve-all-merges' into maint
"git rebase --preserve-merges" lost empty merges in recent versions
of Git.
* ph/rebase-preserve-all-merges:
rebase --preserve-merges: keep all merge commits including empty ones
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 44901d53c..8ed7fccc1 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -190,6 +190,11 @@ is_empty_commit() { test "$tree" = "$ptree" } +is_merge_commit() +{ + git rev-parse --verify --quiet "$1"^2 >/dev/null 2>&1 +} + # Run command with GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and # GIT_AUTHOR_DATE exported from the current environment. do_with_author () { @@ -874,7 +879,7 @@ git rev-list $merges_option --pretty=oneline --abbrev-commit \ while read -r shortsha1 rest do - if test -z "$keep_empty" && is_empty_commit $shortsha1 + if test -z "$keep_empty" && is_empty_commit $shortsha1 && ! is_merge_commit $shortsha1 then comment_out="# " else |