gc -h: show usage even with broken configuration
commit0c8151b6ff5b79e6638e4f8339d62b051998dc2f
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 22 Oct 2010 06:47:19 +0000 (22 01:47 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Oct 2010 18:04:53 +0000 (22 11:04 -0700)
treecccf62beaed093cfc43a601b9d8f1de6fb10d0ae
parent5d3dd915e64ea42ba6bf7646937784f6ddc71422
gc -h: show usage even with broken configuration

Given a request for command-line usage information rather than some
more substantial action, the only friendly thing to do is to report
the usage information as soon as possible and exit.

Without this change, as "git gc" glances over the repository, it can
be distracted by the desire to report a malformed configuration file.

Noticed while working through reports from Duy's repository access
checker.

[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>
builtin/gc.c
t/t6500-gc.sh [new file with mode: 0755]