aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-09-04 18:08:12 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:12 -0700
commitd99825ab73bbe2ae21e3056ffc1b594800a87cd7 (patch)
tree916465e36a2fd4a0eb359c76348532559dfd114a /refs
parent00eebe351c4b4626a7b8e0b2dc4b7a172f3fd8d9 (diff)
downloadgit-d99825ab73bbe2ae21e3056ffc1b594800a87cd7.tar.gz
git-d99825ab73bbe2ae21e3056ffc1b594800a87cd7.tar.xz
add_packed_ref(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c31f9b6f3..08340755d 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1192,10 +1192,9 @@ static struct ref_dir *get_packed_refs(struct files_ref_store *refs)
* lock_packed_refs()). To actually write the packed-refs file, call
* commit_packed_refs().
*/
-static void add_packed_ref(const char *refname, const unsigned char *sha1)
+static void add_packed_ref(struct files_ref_store *refs,
+ const char *refname, const unsigned char *sha1)
{
- struct files_ref_store *refs =
- get_files_ref_store(NULL, "add_packed_ref");
struct packed_ref_cache *packed_ref_cache = get_packed_ref_cache(refs);
if (!packed_ref_cache->lock)
@@ -3869,6 +3868,8 @@ static int ref_present(const char *refname,
int initial_ref_transaction_commit(struct ref_transaction *transaction,
struct strbuf *err)
{
+ struct files_ref_store *refs =
+ get_files_ref_store(NULL, "initial_ref_transaction_commit");
int ret = 0, i;
struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
@@ -3928,7 +3929,7 @@ int initial_ref_transaction_commit(struct ref_transaction *transaction,
if ((update->flags & REF_HAVE_NEW) &&
!is_null_sha1(update->new_sha1))
- add_packed_ref(update->refname, update->new_sha1);
+ add_packed_ref(refs, update->refname, update->new_sha1);
}
if (commit_packed_refs()) {