From da53eec68873e76c68086e405f3f1329d47055b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 22 Oct 2010 01:49:45 -0500 Subject: merge -h: show usage even with corrupt index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of a campaign to make sure "git -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 Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/merge.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/merge.c') diff --git a/builtin/merge.c b/builtin/merge.c index 5f65c0c8a6..584c94f6fb 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"); } -- cgit v1.2.1