Skip to content
  • Jeff King's avatar
    t0012: test "-h" with builtins · d6915511
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    Since commit 99caeed0
    
     (Let 'git <command> -h' show usage
    without a git dir, 2009-11-09), the git wrapper handles "-h"
    specially, skipping any repository setup but still calling
    the builtin's cmd_foo() function. This means that every
    cmd_foo() must be ready to handle this case, but we don't
    have any systematic tests. This led to "git am -h" being
    broken for some time without anybody noticing.
    
    This patch just tests that "git foo -h" works for every
    builtin, where we see a 129 exit code (the normal code for
    our usage() helper), and that the word "usage" appears in
    the output.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    d6915511