diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-02-09 21:53:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-13 15:14:15 -0800 |
commit | 3c0cb0cbaef699f699b79c8be716086053760ea9 (patch) | |
tree | e438fab5d0d8cf500c074b4e3b6db3a01f44afea /refs.c | |
parent | 9c7d772b6b716ec5f81afd3922340588985066b8 (diff) | |
download | git-3c0cb0cbaef699f699b79c8be716086053760ea9.tar.gz |
read_loose_refs(): read refs using resolve_ref_recursively()mh/submodule-hash
There is no need to call read_ref_full() or resolve_gitlink_ref() from
read_loose_refs(), because we already have a ref_store object in hand.
So we can call resolve_ref_recursively() ourselves. Happily, this
unifies the code for the submodule vs. non-submodule cases.
This requires resolve_ref_recursively() to be exposed to the refs
subsystem, though not to non-refs code.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1230,10 +1230,10 @@ int for_each_rawref(each_ref_fn fn, void *cb_data) } /* This function needs to return a meaningful errno on failure */ -static const char *resolve_ref_recursively(struct ref_store *refs, - const char *refname, - int resolve_flags, - unsigned char *sha1, int *flags) +const char *resolve_ref_recursively(struct ref_store *refs, + const char *refname, + int resolve_flags, + unsigned char *sha1, int *flags) { static struct strbuf sb_refname = STRBUF_INIT; int unused_flags; |