]> git.ipfire.org Git - thirdparty/git.git/commit - refs.c
refs: make rev-parse --quiet actually quiet
authorDavid Aguilar <davvid@gmail.com>
Fri, 19 Sep 2014 03:45:37 +0000 (20:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 17:46:15 +0000 (10:46 -0700)
commitc41a87dd80cd32cfd6e2d670153a9b69dc627f71
tree2e46f6355196a3b2c84ef52f32f35c45c5e585e1
parent2892dfeec3f98f7e65a2746d271471d2c3c4af57
refs: make rev-parse --quiet actually quiet

When a reflog is deleted, e.g. when "git stash" clears its stashes,
"git rev-parse --verify --quiet" dies:

fatal: Log for refs/stash is empty.

The reason is that the get_sha1() code path does not allow us
to suppress this message.

Pass the flags bitfield through get_sha1_with_context() so that
read_ref_at() can suppress the message.

Use get_sha1_with_context1() instead of get_sha1() in rev-parse
so that the --quiet flag is honored.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c
builtin/show-branch.c
refs.c
refs.h
sha1_name.c
t/t1503-rev-parse-verify.sh