path: root/wt-status.c
diff options
authorLinus Torvalds <>2009-05-14 20:22:36 (GMT)
committerJunio C Hamano <>2009-07-09 08:11:26 (GMT)
commit1d8842d921cc2695f155f4a10904eeffad085c77 (patch)
tree87186d8b5c8116ec5b442c6f401c2c3a6729de53 /wt-status.c
parentf581de1b7b9d17c83b188bf8ffe536fb8a9dd2a4 (diff)
Add 'fill_directory()' helper function for directory traversal
Most of the users of "read_directory()" actually want a much simpler interface than the whole complex (but rather powerful) one. In fact 'git add' had already largely abstracted out the core interface issues into a private "fill_directory()" function that was largely applicable almost as-is to a number of callers. Yes, 'git add' wants to do some extra work of its own, specific to the add semantics, but we can easily split that out, and use the core as a generic function. This function does exactly that, and now that much simplified 'fill_directory()' function can be shared with a number of callers, while also ensuring that the rather more complex calling conventions of read_directory() are used by fewer call-sites. This also makes the 'common_prefix()' helper function private to dir.c, since all callers are now in that file. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'wt-status.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c
index 0ca4b13..47735d8 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -255,7 +255,7 @@ static void wt_status_print_untracked(struct wt_status *s)
- read_directory(&dir, ".", "", 0, NULL);
+ fill_directory(&dir, NULL);
for(i = 0; i <; i++) {
struct dir_entry *ent = dir.entries[i];
if (!cache_name_is_other(ent->name, ent->len))