git-compat-util.h: don't define _XOPEN_SOURCE on cygwin
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 27927f2319130cc0575817542dfd47c37cc5149b..82e5b1b14f7a6e7341dfcf8fbf61ae3982851e18 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -2387,7 +2387,8 @@ static void try_remove_empty_parents(char *name)
 /* make sure nobody touched the ref, and unlink */
 static void prune_ref(struct ref_to_prune *r)
 {
-       struct ref_lock *lock = lock_ref_sha1(r->name + 5, r->sha1);
+       struct ref_lock *lock = lock_any_ref_for_update(r->name, r->sha1,
+                                                       0, NULL);
 
        if (lock) {
                unlink_or_warn(git_path("%s", r->name));