diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-05-16 19:46:16 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-17 01:56:55 -0700 |
commit | b4189aa84873718f80c62846cd53e803b5f72362 (patch) | |
tree | 72943b160cbe8d377baf5a5cc78f73d587cc5b15 /ls-files.c | |
parent | 453ec4bdf403c2e89892266a0a660c21680d3f9d (diff) | |
download | git-b4189aa84873718f80c62846cd53e803b5f72362.tar.gz git-b4189aa84873718f80c62846cd53e803b5f72362.tar.xz |
Clean up git-ls-file directory walking library interface
This moves the code to add the per-directory ignore files for the base
directory into the library routine.
That not only allows us to turn the function push_exclude_per_directory()
static again, it also simplifies the library interface a lot (the caller
no longer needs to worry about any of the per-directory exclude files at
all).
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r-- | ls-files.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/ls-files.c b/ls-files.c index 89941a3ff..dfe1481a3 100644 --- a/ls-files.c +++ b/ls-files.c @@ -215,28 +215,8 @@ static void show_files(struct dir_struct *dir) const char *path = ".", *base = ""; int baselen = prefix_len; - if (baselen) { + if (baselen) path = base = prefix; - if (dir->exclude_per_dir) { - char *p, *pp = xmalloc(baselen+1); - memcpy(pp, prefix, baselen+1); - p = pp; - while (1) { - char save = *p; - *p = 0; - push_exclude_per_directory(dir, pp, p-pp); - *p++ = save; - if (!save) - break; - p = strchr(p, '/'); - if (p) - p++; - else - p = pp + baselen; - } - free(pp); - } - } read_directory(dir, path, base, baselen); if (show_others) show_other_files(dir); |