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>

Michael Haggerty committed Apr 24, 2016 at 08:11 UTC 8415d24746b97a479fe5aec9845bfc150cda2d14
1 file changed +10 -10
refs/files-backend.c
+10 -10
@@ -1516,6 +1516,16 @@ out:
1516 return ret;
1517 }
1518
1519 +static void unlock_ref(struct ref_lock *lock)
1520 +{
1521 + /* Do not free lock->lk -- atexit() still looks at them */
1522 + if (lock->lk)
1523 + rollback_lock_file(lock->lk);
1524 + free(lock->ref_name);
1525 + free(lock->orig_ref_name);
1526 + free(lock);
1527 +}
1528 +
1529 /*
1530 * Peel the entry (if possible) and return its new peel_status. If
1531 * 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,
1684 return do_for_each_entry(refs, base, do_one_ref, &data);
1685 }
1686
1677 -static void unlock_ref(struct ref_lock *lock)
1678 -{
1679 - /* Do not free lock->lk -- atexit() still looks at them */
1680 - if (lock->lk)
1681 - rollback_lock_file(lock->lk);
1682 - free(lock->ref_name);
1683 - free(lock->orig_ref_name);
1684 - free(lock);
1685 -}
1686 -
1687 /*
1688 * Verify that the reference locked by lock has the value old_sha1.
1689 * Fail if the reference doesn't exist and mustexist is set. Return 0