summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-10-22 06:49:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-10-22 18:04:53 (GMT)
commitda53eec68873e76c68086e405f3f1329d47055b3 (patch)
tree750c54e71333132ec43e222f0bd202ee7b855b61 /builtin/merge.c
parentcbb3167ef8b73109ed5c5e54aa1915d9c50f83d5 (diff)
downloadgit-da53eec68873e76c68086e405f3f1329d47055b3.zip
git-da53eec68873e76c68086e405f3f1329d47055b3.tar.gz
git-da53eec68873e76c68086e405f3f1329d47055b3.tar.bz2
merge -h: show usage even with corrupt index
Part of a campaign to make sure "git <command> -h" works correctly when run from distractingly bad repositories. [jn: with rewritten log message and tests] Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 5f65c0c..584c94f 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -909,6 +909,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
const char *best_strategy = NULL, *wt_strategy = NULL;
struct commit_list **remotes = &remoteheads;
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage_with_options(builtin_merge_usage, builtin_merge_options);
if (read_cache_unmerged()) {
die_resolve_conflict("merge");
}