builtin/apply: convert static functions to struct object_id
[gitweb.git] / builtin / blame.c
index 7ec782343002d27b1b7fdd7e61fada12e81eeaf1..5eb3725de261581fa667b32716965ea7951c2df3 100644 (file)
@@ -2244,7 +2244,8 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
        pos = cache_name_pos(path, strlen(path));
        if (pos >= 0)
                ; /* path is in the index */
-       else if (!strcmp(active_cache[-1 - pos]->name, path))
+       else if (-1 - pos < active_nr &&
+                !strcmp(active_cache[-1 - pos]->name, path))
                ; /* path is in the index, unmerged */
        else
                die("no such path '%s' in HEAD", path);
@@ -2409,7 +2410,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        }
        size = cache_entry_size(len);
        ce = xcalloc(1, size);
-       hashcpy(ce->sha1, origin->blob_sha1);
+       hashcpy(ce->oid.hash, origin->blob_sha1);
        memcpy(ce->name, path, len);
        ce->ce_flags = create_ce_flags(0);
        ce->ce_namelen = len;