mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
Merge branch 'js/pull-rebase-type-shorthand'
"git pull --rebase=interactive" learned "i" as a short-hand for "interactive". * js/pull-rebase-type-shorthand: pull --rebase=<type>: allow single-letter abbreviations for the type
This commit is contained in:
commit
c757aa2d12
@ -48,11 +48,11 @@ static enum rebase_type parse_config_rebase(const char *key, const char *value,
|
||||
return REBASE_FALSE;
|
||||
else if (v > 0)
|
||||
return REBASE_TRUE;
|
||||
else if (!strcmp(value, "preserve"))
|
||||
else if (!strcmp(value, "preserve") || !strcmp(value, "p"))
|
||||
return REBASE_PRESERVE;
|
||||
else if (!strcmp(value, "merges"))
|
||||
else if (!strcmp(value, "merges") || !strcmp(value, "m"))
|
||||
return REBASE_MERGES;
|
||||
else if (!strcmp(value, "interactive"))
|
||||
else if (!strcmp(value, "interactive") || !strcmp(value, "i"))
|
||||
return REBASE_INTERACTIVE;
|
||||
|
||||
if (fatal)
|
||||
|
@ -475,10 +475,22 @@ test_expect_success 'pull.rebase=interactive' '
|
||||
false
|
||||
EOF
|
||||
test_set_editor "$TRASH_DIRECTORY/fake-editor" &&
|
||||
test_when_finished "test_might_fail git rebase --abort" &&
|
||||
test_must_fail git pull --rebase=interactive . copy &&
|
||||
test "I was here" = "$(cat fake.out)"
|
||||
'
|
||||
|
||||
test_expect_success 'pull --rebase=i' '
|
||||
write_script "$TRASH_DIRECTORY/fake-editor" <<-\EOF &&
|
||||
echo I was here, too >fake.out &&
|
||||
false
|
||||
EOF
|
||||
test_set_editor "$TRASH_DIRECTORY/fake-editor" &&
|
||||
test_when_finished "test_might_fail git rebase --abort" &&
|
||||
test_must_fail git pull --rebase=i . copy &&
|
||||
test "I was here, too" = "$(cat fake.out)"
|
||||
'
|
||||
|
||||
test_expect_success 'pull.rebase=invalid fails' '
|
||||
git reset --hard before-preserve-rebase &&
|
||||
test_config pull.rebase invalid &&
|
||||
|
Loading…
Reference in New Issue
Block a user