Re: [BUG] Git add <device file> silently fails
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:40
Andreas Gruenbacher [off-list ref] writes:
quoted hunk
@@ -720,7 +723,8 @@ static enum path_treatment treat_one_path(struct dir_struct *dir, switch (dtype) { default: - return path_ignored; + dir_add_ignored(dir, path, *len, DIR_IGNORED_FILETYPE); + break;
Hmm, do we want to break and return path_handled here, to cause the calling read_directory_recursive() to call dir_add_name()? Also I suspect that (dir->flags & DIR_COLLECT_IGNORED) needs to be checked before making this call.
+struct dir_vector {
+ int nr, alloc;
+ struct dir_entry **entries;
+};We would probably call a structure of this shape "dir_array", as I haven't seen us calling anything "vector" for naming consistency. Instead of introducing two dir-arrays for different kinds of ignoredness, it may be cleaner to add one bit (or more for later expansion) to dir_entry and mark the ones in ignored dir-array with the ignore reason.