|
183 | 183 | test_cmp expected actual
|
184 | 184 | '
|
185 | 185 |
|
| 186 | +test_expect_success 'status during rebase -ir after conflicted merge (exec git merge)' ' |
| 187 | + git reset --hard main && |
| 188 | + git checkout -b rebase_i_merge && |
| 189 | + test_commit unrelated && |
| 190 | + git checkout -b rebase_i_merge_side && |
| 191 | + test_commit side2 main.txt && |
| 192 | + git checkout rebase_i_merge && |
| 193 | + test_commit side1 main.txt && |
| 194 | + PICK=$(git rev-parse --short rebase_i_merge) && |
| 195 | + test_must_fail git merge rebase_i_merge_side && |
| 196 | + echo side1 >main.txt && |
| 197 | + git add main.txt && |
| 198 | + test_tick && |
| 199 | + git commit --no-edit && |
| 200 | + MERGE=$(git rev-parse --short rebase_i_merge) && |
| 201 | + ONTO=$(git rev-parse --short main) && |
| 202 | + test_when_finished "git rebase --abort" && |
| 203 | + FAKE_LINES="1 2 3 5 6 7 8 9 10 exec_git_merge_refs/rewritten/rebase-i-merge-side" && |
| 204 | + export FAKE_LINES && |
| 205 | + test_must_fail git rebase -ir main && |
| 206 | + cat >expect <<EOF && |
| 207 | +interactive rebase in progress; onto $ONTO |
| 208 | +Last commands done (8 commands done): |
| 209 | + pick $PICK side1 |
| 210 | + exec git merge refs/rewritten/rebase-i-merge-side |
| 211 | + (see more in file .git/rebase-merge/done) |
| 212 | +No commands remaining. |
| 213 | +
|
| 214 | +You have unmerged paths. |
| 215 | + (fix conflicts and run "git commit") |
| 216 | + (use "git merge --abort" to abort the merge) |
| 217 | +
|
| 218 | +Unmerged paths: |
| 219 | + (use "git add <file>..." to mark resolution) |
| 220 | + both modified: main.txt |
| 221 | +
|
| 222 | +no changes added to commit (use "git add" and/or "git commit -a") |
| 223 | +EOF |
| 224 | + git status --untracked-files=no >actual && |
| 225 | + test_cmp expect actual |
| 226 | +' |
| 227 | + |
| 228 | +test_expect_success 'status during rebase -ir after replaying conflicted merge (merge)' ' |
| 229 | + PICK=$(git rev-parse --short :/side1) && |
| 230 | + UNRELATED=$(git rev-parse --short :/unrelated) && |
| 231 | + MERGE=$(git rev-parse --short rebase_i_merge) && |
| 232 | + ONTO=$(git rev-parse --short main) && |
| 233 | + test_when_finished "git rebase --abort" && |
| 234 | + FAKE_LINES="1 2 3 5 6 7 8 9 10 11 4" && |
| 235 | + export FAKE_LINES && |
| 236 | + test_must_fail git rebase -ir main && |
| 237 | + cat >expect <<EOF && |
| 238 | +interactive rebase in progress; onto $ONTO |
| 239 | +Last commands done (8 commands done): |
| 240 | + pick $PICK side1 |
| 241 | + merge -C $MERGE rebase-i-merge-side # Merge branch '\''rebase_i_merge_side'\'' into rebase_i_merge |
| 242 | + (see more in file .git/rebase-merge/done) |
| 243 | +Next command to do (1 remaining command): |
| 244 | + pick $UNRELATED unrelated |
| 245 | + (use "git rebase --edit-todo" to view and edit) |
| 246 | +You are currently rebasing branch '\''rebase_i_merge'\'' on '\''$ONTO'\''. |
| 247 | + (fix conflicts and then run "git rebase --continue") |
| 248 | + (use "git rebase --skip" to skip this patch) |
| 249 | + (use "git rebase --abort" to check out the original branch) |
| 250 | +
|
| 251 | +Unmerged paths: |
| 252 | + (use "git add <file>..." to mark resolution) |
| 253 | + both modified: main.txt |
| 254 | +
|
| 255 | +no changes added to commit (use "git add" and/or "git commit -a") |
| 256 | +EOF |
| 257 | + git status --untracked-files=no >actual && |
| 258 | + test_cmp expect actual |
| 259 | +' |
| 260 | + |
186 | 261 |
|
187 | 262 | test_expect_success 'status when rebasing -i in edit mode' '
|
188 | 263 | git reset --hard main &&
|
|
0 commit comments