Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Let scan_tree choose the project list itself
Three callers wrote out the same choice, and the header already says a scan visits only the listed paths when a project list is set.
Diffstat (limited to '')
-rw-r--r--source/scan-tree.c7
1 file changed, 5 insertions, 2 deletions
diff --git a/source/scan-tree.c b/source/scan-tree.c
index 10f661d..ed50769 100644
--- a/source/scan-tree.c
+++ b/source/scan-tree.c
@@ -344,7 +344,7 @@ end:
closedir(dir);
}
-void scan_projects(const char *path, const char *projectsfile)
+static void scan_projects(const char *path, const char *projectsfile)
{
struct strbuf line = STRBUF_INIT;
FILE *projects;
@@ -374,5 +374,8 @@ void scan_projects(const char *path, const char *projectsfile)
void scan_tree(const char *path)
{
- scan_path(path, path);
+ if (ctx.cfg.project_list)
+ scan_projects(path, ctx.cfg.project_list);
+ else
+ scan_path(path, path);
}