| test_description='test git rev-list --cherry-pick -- file' |
| # B changes a file foo.c, adding a line of text. C changes foo.c as |
| # well as bar.c, but the change in foo.c was identical to change B. |
| test_expect_success setup ' |
| git checkout -b branch && |
| git checkout branch foo && |
| test_expect_success '--cherry-pick foo comes up empty' ' |
| test -z "$(git rev-list --left-right --cherry-pick B...C -- foo)" |
| test_expect_success '--cherry-pick bar does not come up empty' ' |
| ! test -z "$(git rev-list --left-right --cherry-pick B...C -- bar)" |
| test_expect_success '--cherry-pick with independent, but identical branches' ' |
| git symbolic-ref HEAD refs/heads/independent && |
| git commit -m "independent" && |
| git commit -m "independent, too" foo && |
| test -z "$(git rev-list --left-right --cherry-pick \ |