Commit 6a143aa
checkout -m: attempt merge when deletion of path was staged
twoway_merge() is missing an o->gently check in the case where a file
that needs to be modified is missing from the index but present in the
old and new trees. As a result, in this case 'git checkout -m' errors
out instead of trying to perform a merge.
Fix it by checking o->gently. While at it, inline the o->gently check
into reject_merge to prevent future call sites from making the same
mistake.
Noticed by code inspection. The test for the motivating case was
added by JC.
Signed-off-by: Jonathan Nieder <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 6c1db1b commit 6a143aa
2 files changed
+23
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
226 | 243 | | |
227 | 244 | | |
228 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | | - | |
| 1181 | + | |
| 1182 | + | |
1182 | 1183 | | |
1183 | 1184 | | |
1184 | 1185 | | |
| |||
1633 | 1634 | | |
1634 | 1635 | | |
1635 | 1636 | | |
1636 | | - | |
| 1637 | + | |
1637 | 1638 | | |
1638 | 1639 | | |
1639 | 1640 | | |
1640 | 1641 | | |
1641 | 1642 | | |
1642 | 1643 | | |
1643 | 1644 | | |
1644 | | - | |
| 1645 | + | |
1645 | 1646 | | |
1646 | 1647 | | |
1647 | 1648 | | |
| |||
1770 | 1771 | | |
1771 | 1772 | | |
1772 | 1773 | | |
1773 | | - | |
| 1774 | + | |
1774 | 1775 | | |
1775 | 1776 | | |
1776 | 1777 | | |
| |||
1788 | 1789 | | |
1789 | 1790 | | |
1790 | 1791 | | |
1791 | | - | |
| 1792 | + | |
1792 | 1793 | | |
1793 | 1794 | | |
1794 | 1795 | | |
| |||
0 commit comments