Commit c889763b authored by Junio C Hamano's avatar Junio C Hamano

Revert "read_directory: show_both option."

This reverts commit 4888c534.
parent 8757749e
...@@ -260,8 +260,7 @@ int excluded(struct dir_struct *dir, const char *pathname) ...@@ -260,8 +260,7 @@ int excluded(struct dir_struct *dir, const char *pathname)
return 0; return 0;
} }
static void add_name(struct dir_struct *dir, const char *pathname, int len, static void add_name(struct dir_struct *dir, const char *pathname, int len)
int ignored_entry)
{ {
struct dir_entry *ent; struct dir_entry *ent;
...@@ -274,7 +273,6 @@ static void add_name(struct dir_struct *dir, const char *pathname, int len, ...@@ -274,7 +273,6 @@ static void add_name(struct dir_struct *dir, const char *pathname, int len,
dir->entries = xrealloc(dir->entries, alloc*sizeof(ent)); dir->entries = xrealloc(dir->entries, alloc*sizeof(ent));
} }
ent = xmalloc(sizeof(*ent) + len + 1); ent = xmalloc(sizeof(*ent) + len + 1);
ent->ignored_entry = ignored_entry;
ent->len = len; ent->len = len;
memcpy(ent->name, pathname, len); memcpy(ent->name, pathname, len);
ent->name[len] = 0; ent->name[len] = 0;
...@@ -316,7 +314,6 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co ...@@ -316,7 +314,6 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co
while ((de = readdir(fdir)) != NULL) { while ((de = readdir(fdir)) != NULL) {
int len; int len;
int ignored_entry;
if ((de->d_name[0] == '.') && if ((de->d_name[0] == '.') &&
(de->d_name[1] == 0 || (de->d_name[1] == 0 ||
...@@ -325,12 +322,11 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co ...@@ -325,12 +322,11 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co
continue; continue;
len = strlen(de->d_name); len = strlen(de->d_name);
memcpy(fullname + baselen, de->d_name, len+1); memcpy(fullname + baselen, de->d_name, len+1);
ignored_entry = excluded(dir, fullname); if (excluded(dir, fullname) != dir->show_ignored) {
if (!dir->show_ignored || DTYPE(de) != DT_DIR) {
if (!dir->show_both && continue;
(ignored_entry != dir->show_ignored) && }
(!dir->show_ignored || DTYPE(de) != DT_DIR)) }
continue;
switch (DTYPE(de)) { switch (DTYPE(de)) {
struct stat st; struct stat st;
...@@ -368,8 +364,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co ...@@ -368,8 +364,7 @@ static int read_directory_recursive(struct dir_struct *dir, const char *path, co
if (check_only) if (check_only)
goto exit_early; goto exit_early;
else else
add_name(dir, fullname, baselen + len, add_name(dir, fullname, baselen + len);
ignored_entry);
} }
exit_early: exit_early:
closedir(fdir); closedir(fdir);
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
struct dir_entry { struct dir_entry {
unsigned ignored_entry : 1; int len;
unsigned int len : 15;
char name[FLEX_ARRAY]; /* more */ char name[FLEX_ARRAY]; /* more */
}; };
...@@ -30,8 +29,7 @@ struct exclude_list { ...@@ -30,8 +29,7 @@ struct exclude_list {
struct dir_struct { struct dir_struct {
int nr, alloc; int nr, alloc;
unsigned int show_both: 1, unsigned int show_ignored:1,
show_ignored:1,
show_other_directories:1, show_other_directories:1,
hide_empty_directories:1; hide_empty_directories:1;
struct dir_entry **entries; struct dir_entry **entries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment