commit - 9d2a8e53001829e269993f447f64cde7978a9415
commit + bad322f27728dd8cfc8c8b5234bb5d55b074f544
blob - 111eba88f1fbb135027e58689c5903153f73067b
blob + aad51a99e4e1fbefe104d77b6aa2127ab52eb605
--- lib/fileindex.c
+++ lib/fileindex.c
}
/*
- * Decide whether ie or te are equivalent, and if they aren't,
- * then decide which should be processed first.
+ * Decide whether a fileindex entry path is equivalent to a tree entry path,
+ * and if it is not, then decide which of the two should be processed first.
*/
static int
-cmp_entries(struct got_fileindex_entry *ie, const char *parent_path,
- size_t parent_len, struct got_tree_entry *te)
+cmp_entries(const char *ie_path, const char *parent_path,
+ size_t parent_len, const char *te_name)
{
- int cmp = strncmp(ie->path, parent_path, parent_len);
+ int cmp = strncmp(ie_path, parent_path, parent_len);
if (cmp == 0 || parent_len == 0) {
- char *ie_name = ie->path + parent_len;
+ const char *ie_name = ie_path + parent_len;
while (ie_name[0] == '/')
ie_name++;
- cmp = strcmp(ie_name, te->name);
+ cmp = strcmp(ie_name, te_name);
}
return cmp;
te = SIMPLEQ_FIRST(&entries->head);
do {
if (te && *ie) {
- int cmp = cmp_entries(*ie, path, path_len, te);
+ int cmp = cmp_entries((*ie)->path, path, path_len,
+ te->name);
if (cmp == 0) {
err = cb->diff_old_new(cb_arg, *ie, te,
path);