mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log'
We tried to bend backwards to allow "--quiet" to be a synonym as "-s" when given as e.g. "git show --quiet", but did not quite succeed. * jk/maint-quiet-is-synonym-to-s-in-log: log: fix --quiet synonym for -s
This commit is contained in:
commit
1c0712dea8
|
@ -109,9 +109,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
|
|||
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
|
||||
PARSE_OPT_KEEP_DASHDASH);
|
||||
|
||||
argc = setup_revisions(argc, argv, rev, opt);
|
||||
if (quiet)
|
||||
rev->diffopt.output_format |= DIFF_FORMAT_NO_OUTPUT;
|
||||
argc = setup_revisions(argc, argv, rev, opt);
|
||||
|
||||
/* Any arguments at this point are not recognized */
|
||||
if (argc > 1)
|
||||
|
|
|
@ -108,4 +108,16 @@ test_expect_success 'showing range' '
|
|||
test_cmp expect actual.filtered
|
||||
'
|
||||
|
||||
test_expect_success '-s suppresses diff' '
|
||||
echo main3 >expect &&
|
||||
git show -s --format=%s main3 >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success '--quiet suppresses diff' '
|
||||
echo main3 >expect &&
|
||||
git show --quiet --format=%s main3 >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue