summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/checkout.c10
-rwxr-xr-xt/t9902-completion.sh2
2 files changed, 6 insertions, 6 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 2b3b768eff..c7670dbbfe 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1119,10 +1119,12 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
OPT_SET_INT('t', "track", &opts.track, N_("set upstream info for new branch"),
BRANCH_TRACK_EXPLICIT),
OPT_STRING(0, "orphan", &opts.new_orphan_branch, N_("new-branch"), N_("new unparented branch")),
- OPT_SET_INT('2', "ours", &opts.writeout_stage, N_("checkout our version for unmerged files"),
- 2),
- OPT_SET_INT('3', "theirs", &opts.writeout_stage, N_("checkout their version for unmerged files"),
- 3),
+ OPT_SET_INT_F('2', "ours", &opts.writeout_stage,
+ N_("checkout our version for unmerged files"),
+ 2, PARSE_OPT_NONEG),
+ OPT_SET_INT_F('3', "theirs", &opts.writeout_stage,
+ N_("checkout their version for unmerged files"),
+ 3, PARSE_OPT_NONEG),
OPT__FORCE(&opts.force, N_("force checkout (throw away local modifications)"),
PARSE_OPT_NOCOMPLETE),
OPT_BOOL('m', "merge", &opts.merge, N_("perform a 3-way merge with the new branch")),
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 07c3e3b760..7e5e3ad5b1 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1245,9 +1245,7 @@ test_expect_success 'double dash "git checkout"' '
--orphan=Z
--no-orphan Z
--ours Z
- --no-ours Z
--theirs Z
- --no-theirs Z
--merge Z
--no-merge Z
--conflict=Z