aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-04-24 08:11:37 +0200
committerMichael Haggerty <mhagger@alum.mit.edu>2016-06-13 11:23:49 +0200
commit8415d24746b97a479fe5aec9845bfc150cda2d14 (patch)
treedbb3950d5787f692a2ee03602b3dcf2153089077 /refs
parent165056b2fc065e27e4077a11ed2bf1589207b997 (diff)
downloadgit-8415d24746b97a479fe5aec9845bfc150cda2d14.tar.gz
git-8415d24746b97a479fe5aec9845bfc150cda2d14.tar.xz
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 85751977f..dc0bde05b 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1516,6 +1516,16 @@ out:
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