Merge branch 'ma/regex-no-regfree-after-comp-fail'
[gitweb.git] / builtin / rm.c
index 4447bb4d0faf8c34f3fc96361a651eaad396d6d4..65b448ef8ee91079194841762d4b7a2193eec9a9 100644 (file)
@@ -178,7 +178,7 @@ static int check_local_mod(struct object_id *head, int index_only)
                 * way as changed from the HEAD.
                 */
                if (no_head
-                    || get_tree_entry(head->hash, name, oid.hash, &mode)
+                    || get_tree_entry(head, name, &oid, &mode)
                     || ce->ce_mode != create_ce_mode(mode)
                     || oidcmp(&ce->oid, &oid))
                        staged_changes = 1;
@@ -233,8 +233,6 @@ static int check_local_mod(struct object_id *head, int index_only)
        return errs;
 }
 
-static struct lock_file lock_file;
-
 static int show_only = 0, force = 0, index_only = 0, recursive = 0, quiet = 0;
 static int ignore_unmatch = 0;
 
@@ -251,6 +249,7 @@ static struct option builtin_rm_options[] = {
 
 int cmd_rm(int argc, const char **argv, const char *prefix)
 {
+       struct lock_file lock_file = LOCK_INIT;
        int i;
        struct pathspec pathspec;
        char *seen;