]> git.ipfire.org Git - thirdparty/git.git/commit - http-backend.c
refs.c: change resolve_ref_unsafe reading argument to be a flags field
authorRonnie Sahlberg <sahlberg@google.com>
Tue, 15 Jul 2014 19:59:36 +0000 (12:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2014 17:47:24 +0000 (10:47 -0700)
commit7695d118e5a3c9c6fcb4cb15eb766a1c57422aed
tree53872b12d57c9f7fca48379262baff5d4f4051eb
parentaae383db8c384dc46abe199899235f67c838e601
refs.c: change resolve_ref_unsafe reading argument to be a flags field

resolve_ref_unsafe takes a boolean argument for reading (a nonexistent ref
resolves successfully for writing but not for reading).  Change this to be
a flags field instead, and pass the new constant RESOLVE_REF_READING when
we want this behaviour.

While at it, swap two of the arguments in the function to put output
arguments at the end.  As a nice side effect, this ensures that we can
catch callers that were unaware of the new API so they can be audited.

Give the wrapper functions resolve_refdup and read_ref_full the same
treatment for consistency.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
28 files changed:
branch.c
builtin/blame.c
builtin/branch.c
builtin/checkout.c
builtin/clone.c
builtin/commit.c
builtin/fmt-merge-msg.c
builtin/for-each-ref.c
builtin/fsck.c
builtin/log.c
builtin/merge.c
builtin/notes.c
builtin/receive-pack.c
builtin/remote.c
builtin/show-branch.c
builtin/symbolic-ref.c
bundle.c
cache.h
http-backend.c
notes-merge.c
reflog-walk.c
refs.c
remote.c
sequencer.c
transport-helper.c
transport.c
upload-pack.c
wt-status.c