Commit 7b76ac6
git-legacy-rebase: simplify unnecessary triply-nested if
The git-legacy-rebase.sh script previously had code of the form:
if git_am_opt:
if interactive:
if incompatible_opts:
show_error_about_interactive_and_am_incompatibilities
if rebase-merge:
if incompatible_opts
show_error_about_merge_and_am_incompatibilities
which was a triply nested if. However, the first conditional
(git_am_opt) and third (incompatible_opts) were somewhat redundant: the
latter condition was a strict subset of the former. Simplify this by
moving the innermost conditional to the outside, allowing us to remove
the test on git_am_opt entirely and giving us the following form:
if incompatible_opts:
if interactive:
show_error_about_interactive_and_am_incompatibilities
if rebase-merge:
show_error_about_merge_and_am_incompatibilities
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 899b49c commit 7b76ac6
1 file changed
+8
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
507 | 508 | | |
508 | 509 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 510 | + | |
513 | 511 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
519 | 515 | | |
520 | 516 | | |
521 | 517 | | |
| |||
0 commit comments