Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2016-12-14 11:37:57 +0300
committerJunio C Hamano <gitster@pobox.com>2016-12-14 21:02:04 +0300
commit042e290da6aee0a9f21cd5890ccf231c266e177e (patch)
tree7056cb718d62c88dc75614b7f8b1a3c263bab346 /builtin/merge.c
parentc261a87e704679203510d48ff4db7bc7006b8a5a (diff)
merge: ensure '--abort' option takes no arguments
Like '--continue', the '--abort' option doesn't make any sense with other options or arguments to 'git merge' so ensure that none are present. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 836ec281b4..668aaffb84 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1163,6 +1163,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
int nargc = 2;
const char *nargv[] = {"reset", "--merge", NULL};
+ if (orig_argc != 2)
+ usage_msg_opt("--abort expects no arguments",
+ builtin_merge_usage, builtin_merge_options);
+
if (!file_exists(git_path_merge_head()))
die(_("There is no merge to abort (MERGE_HEAD missing)."));