]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-apply.c
Merge branch 'jk/maint-rmdir-fix' into maint
[git.git] / builtin-apply.c
index 218363fe04bafa70ac205542c94ddc9002aec48e..3af4ae0c269bc8a2cb1bb4240af1f191d2ba0442 100644 (file)
@@ -692,7 +692,7 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
                if (isnull)
                        die("git apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
                another = find_name(line, NULL, p_value, TERM_TAB);
-               if (!another || memcmp(another, name, len))
+               if (!another || memcmp(another, name, len + 1))
                        die("git apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
                free(another);
                return orig_name;
@@ -2006,7 +2006,7 @@ static int find_pos(struct image *img,
                return -1;
 
        /*
-        * If match_begining or match_end is specified, there is no
+        * If match_beginning or match_end is specified, there is no
         * point starting from a wrong line that will never match and
         * wander around and wait for a match at the specified end.
         */
@@ -2673,7 +2673,7 @@ static int verify_index_match(struct cache_entry *ce, struct stat *st)
                        return -1;
                return 0;
        }
-       return ce_match_stat(ce, st, CE_MATCH_IGNORE_VALID);
+       return ce_match_stat(ce, st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE);
 }
 
 static int check_preimage(struct patch *patch, struct cache_entry **ce, struct stat *st)