projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "git-push: avoid falling back on pushing "matching" refs."
[git.git]
/
ls-files.c
diff --git
a/ls-files.c
b/ls-files.c
index
841c98a
..
6af3b09
100644
(file)
--- a/
ls-files.c
+++ b/
ls-files.c
@@
-209,7
+209,7
@@
static int excluded(const char *pathname)
struct nond_on_fs {
int len;
struct nond_on_fs {
int len;
- char name[
0];
+ char name[
FLEX_ARRAY]; /* more */
};
static struct nond_on_fs **dir;
};
static struct nond_on_fs **dir;
@@
-240,11
+240,9
@@
static int dir_exists(const char *dirname, int len)
if (pos >= 0)
return 1;
pos = -pos-1;
if (pos >= 0)
return 1;
pos = -pos-1;
- if (pos >= active_nr)
+ if (pos >= active_nr)
/* can't */
return 0;
return 0;
- if (strncmp(active_cache[pos]->name, dirname, len))
- return 0;
- return active_cache[pos]->name[len] == '/';
+ return !strncmp(active_cache[pos]->name, dirname, len);
}
/*
}
/*
@@
-294,13
+292,13
@@
static void read_directory(const char *path, const char *base, int baselen)
continue;
/* fallthrough */
case DT_DIR:
continue;
/* fallthrough */
case DT_DIR:
- if (show_other_directories) {
- if (!dir_exists(fullname, baselen + len))
- break;
- }
memcpy(fullname + baselen + len, "/", 2);
memcpy(fullname + baselen + len, "/", 2);
+ len++;
+ if (show_other_directories &&
+ !dir_exists(fullname, baselen + len))
+ break;
read_directory(fullname, fullname,
read_directory(fullname, fullname,
- baselen + len
+ 1
);
+ baselen + len);
continue;
case DT_REG:
case DT_LNK:
continue;
case DT_REG:
case DT_LNK: