Fix refs.c;:repack_without_ref() clean-up path
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 858c53445c01fc0ed0db2affc99ddf9b9c319e19..aa4c4e0b94585835298ad1785eee77462760e2d6 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -498,7 +498,7 @@ static int remove_empty_dir_recursive(char *path, int len)
                    strcpy(path + len, e->d_name) &&
                    !lstat(path, &st) &&
                    S_ISDIR(st.st_mode) &&
-                   remove_empty_dir_recursive(path, len + namlen))
+                   !remove_empty_dir_recursive(path, len + namlen))
                        continue; /* happy */
 
                /* path too long, stat fails, or non-directory still exists */
@@ -621,12 +621,13 @@ struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *o
        return lock_ref_sha1_basic(ref, old_sha1, NULL);
 }
 
+static struct lock_file packlock;
+
 static int repack_without_ref(const char *refname)
 {
        struct ref_list *list, *packed_ref_list;
        int fd;
        int found = 0;
-       struct lock_file packlock;
 
        packed_ref_list = get_packed_refs();
        for (list = packed_ref_list; list; list = list->next) {