diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-31 15:05:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-31 15:05:59 -0700 |
commit | 381ca9a3bcfb6eae40340ecd683b189fd5781f14 (patch) | |
tree | c75bc27567c0e6cdc4110b2f8d9c266ca20f0038 /apply.c | |
parent | 97658004c311c54e2e4755dc545a9da261bd1441 (diff) | |
download | git-381ca9a3bcfb6eae40340ecd683b189fd5781f14.tar.gz |
git-apply: don't try to be clever about filenames and the index
It just causes things like "git-apply --stat" to parse traditional
patch headers differently depending on what your index is, which
is nasty.
Diffstat (limited to 'apply.c')
-rw-r--r-- | apply.c | 18 |
1 files changed, 5 insertions, 13 deletions
@@ -116,9 +116,8 @@ static int is_dev_null(const char *str) return !memcmp("/dev/null", str, 9) && isspace(str[9]); } -#define TERM_EXIST 1 -#define TERM_SPACE 2 -#define TERM_TAB 4 +#define TERM_SPACE 1 +#define TERM_TAB 2 static int name_terminate(const char *name, int namelen, int c, int terminate) { @@ -127,13 +126,6 @@ static int name_terminate(const char *name, int namelen, int c, int terminate) if (c == '\t' && !(terminate & TERM_TAB)) return 0; - /* - * Do we want an existing name? Return false and - * continue if it's not there. - */ - if (terminate & TERM_EXIST) - return cache_name_pos(name, namelen) >= 0; - return 1; } @@ -205,11 +197,11 @@ static void parse_traditional_patch(const char *first, const char *second, struc } else if (is_dev_null(second)) { patch->is_new = 0; patch->is_delete = 1; - name = find_name(first, NULL, p_value, TERM_EXIST | TERM_SPACE | TERM_TAB); + name = find_name(first, NULL, p_value, TERM_SPACE | TERM_TAB); patch->old_name = name; } else { - name = find_name(first, NULL, p_value, TERM_EXIST | TERM_SPACE | TERM_TAB); - name = find_name(second, name, p_value, TERM_EXIST | TERM_SPACE | TERM_TAB); + name = find_name(first, NULL, p_value, TERM_SPACE | TERM_TAB); + name = find_name(second, name, p_value, TERM_SPACE | TERM_TAB); patch->old_name = patch->new_name = name; } if (!name) |