return ignore_case ? strihash(path) : strhash(path);
}
- struct hashmap_entry ent; /* must be the first member! */
+/*
+ * For dir_rename_entry, directory names are stored as a full path from the
+ * toplevel of the repository and do not include a trailing '/'. Also:
+ *
+ * dir: original name of directory being renamed
+ * non_unique_new_dir: if true, could not determine new_dir
+ * new_dir: final name of directory being renamed
+ * possible_new_dirs: temporary used to help determine new_dir; see comments
+ * in get_directory_renames() for details
+ */
+struct dir_rename_entry {
++ struct hashmap_entry ent;
+ char *dir;
+ unsigned non_unique_new_dir:1;
+ struct strbuf new_dir;
+ struct string_list possible_new_dirs;
+};
+
static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap,
char *dir)
{
string_list_init(&entry->possible_new_dirs, 0);
}
- struct hashmap_entry ent; /* must be the first member! */
+struct collision_entry {
++ struct hashmap_entry ent;
+ char *target_file;
+ struct string_list source_files;
+ unsigned reported_already:1;
+};
+
static struct collision_entry *collision_find_entry(struct hashmap *hashmap,
char *target_file)
{
strbuf_addstr(base, path);
FLEX_ALLOC_MEM(entry, path, base->buf, base->len);
- hashmap_entry_init(entry, path_hash(entry->path));
- hashmap_add(&opt->priv->current_file_dir_set, entry);
+ hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, &entry->e);
++ hashmap_add(&opt->priv->current_file_dir_set, &entry->e);
strbuf_setlen(base, baselen);
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
}
FLEX_ALLOC_MEM(entry, path, newpath.buf, newpath.len);
- hashmap_entry_init(entry, path_hash(entry->path));
- hashmap_add(&opt->priv->current_file_dir_set, entry);
+ hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, &entry->e);
++ hashmap_add(&opt->priv->current_file_dir_set, &entry->e);
return strbuf_detach(&newpath, NULL);
}
string_list_clear(entries, 1);
free(entries);
- hashmap_free(&opt->priv->current_file_dir_set, 1);
- hashmap_free_entries(&opt->current_file_dir_set,
++ hashmap_free_entries(&opt->priv->current_file_dir_set,
+ struct path_hashmap_entry, e);
if (clean < 0) {
unpack_trees_finish(opt);