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)
{
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;
}
} 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)
return 0;
}
+static int gitdiff_dissimilarity(const char *line, struct patch *patch)
+{
+ return 0;
+}
+
/*
* This is normal for a diff that doesn't change anything: we'll fall through
* into the next diff. Tell the parser to break out.
{ "rename from ", gitdiff_renamesrc },
{ "rename to ", gitdiff_renamedst },
{ "similarity index ", gitdiff_similarity },
+ { "dissimilarity index ", gitdiff_dissimilarity },
{ "", gitdiff_unrecognized },
};
int i;