1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 16:06:38 +02:00

unlock_ref(): move definition higher in the file

This avoids the need for a forward declaration in the next patch.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
This commit is contained in:
Michael Haggerty 2016-04-24 08:11:37 +02:00
parent 165056b2fc
commit 8415d24746

View File

@ -1516,6 +1516,16 @@ int read_raw_ref(const char *refname, unsigned char *sha1,
return ret;
}
static void unlock_ref(struct ref_lock *lock)
{
/* Do not free lock->lk -- atexit() still looks at them */
if (lock->lk)
rollback_lock_file(lock->lk);
free(lock->ref_name);
free(lock->orig_ref_name);
free(lock);
}
/*
* Peel the entry (if possible) and return its new peel_status. If
* repeel is true, re-peel the entry even if there is an old peeled
@ -1674,16 +1684,6 @@ int do_for_each_ref(const char *submodule, const char *base,
return do_for_each_entry(refs, base, do_one_ref, &data);
}
static void unlock_ref(struct ref_lock *lock)
{
/* Do not free lock->lk -- atexit() still looks at them */
if (lock->lk)
rollback_lock_file(lock->lk);
free(lock->ref_name);
free(lock->orig_ref_name);
free(lock);
}
/*
* Verify that the reference locked by lock has the value old_sha1.
* Fail if the reference doesn't exist and mustexist is set. Return 0