From: Junio C Hamano Date: Mon, 27 Feb 2017 21:57:15 +0000 (-0800) Subject: Merge branch 'mh/submodule-hash' X-Git-Tag: v2.13.0-rc0~166 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=466be3e1dedc2725a436b128469b454ad8f1f578;p=thirdparty%2Fgit.git Merge branch 'mh/submodule-hash' Code and design clean-up for the refs API. * mh/submodule-hash: read_loose_refs(): read refs using resolve_ref_recursively() files_ref_store::submodule: use NULL for the main repository base_ref_store_init(): remove submodule argument refs: push the submodule attribute down refs: store submodule ref stores in a hashmap register_ref_store(): new function refs: remove some unnecessary handling of submodule == "" refs: make some ref_store lookup functions private refs: reorder some function definitions --- 466be3e1dedc2725a436b128469b454ad8f1f578 diff --cc refs/files-backend.c index 21e116d4e6,cdb6b8ff57..db3bd42a91 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@@ -2007,11 -2015,13 +2022,11 @@@ static struct ref_lock *lock_ref_sha1_b struct strbuf ref_file = STRBUF_INIT; struct ref_lock *lock; int last_errno = 0; - int lflags = LOCK_NO_DEREF; int mustexist = (old_sha1 && !is_null_sha1(old_sha1)); int resolve_flags = RESOLVE_REF_NO_RECURSE; - int attempts_remaining = 3; int resolved; - assert_main_repository(&refs->base, "lock_ref_sha1_basic"); + files_assert_main_repository(refs, "lock_ref_sha1_basic"); assert(err); lock = xcalloc(1, sizeof(struct ref_lock)); @@@ -2902,11 -2945,10 +2917,11 @@@ static int commit_ref_update(struct fil const unsigned char *sha1, const char *logmsg, struct strbuf *err) { - assert_main_repository(&refs->base, "commit_ref_update"); + files_assert_main_repository(refs, "commit_ref_update"); clear_loose_ref_cache(refs); - if (log_ref_write(lock->ref_name, lock->old_oid.hash, sha1, logmsg, 0, err)) { + if (files_log_ref_write(lock->ref_name, lock->old_oid.hash, sha1, + logmsg, 0, err)) { char *old_msg = strbuf_detach(err, NULL); strbuf_addf(err, "cannot update the ref '%s': %s", lock->ref_name, old_msg);