Merge branch 'jc/worktree-config' into maint
[gitweb.git] / builtin / blame.c
index 7ec782343002d27b1b7fdd7e61fada12e81eeaf1..f618392e55f70966accc49aa7ff22de2d16f189f 100644 (file)
@@ -2111,7 +2111,7 @@ static void find_alignment(struct scoreboard *sb, int *option)
        unsigned largest_score = 0;
        struct blame_entry *e;
        int compute_auto_abbrev = (abbrev < 0);
-       int auto_abbrev = default_abbrev;
+       int auto_abbrev = DEFAULT_ABBREV;
 
        for (e = sb->ent; e; e = e->next) {
                struct origin *suspect = e->suspect;
@@ -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);