]> granicus.if.org Git - cgit/commitdiff
scan-tree: detect non-bare repository and stop scanning early
authorLars Hjemli <hjemli@gmail.com>
Tue, 11 Aug 2009 08:08:12 +0000 (10:08 +0200)
committerLars Hjemli <hjemli@gmail.com>
Mon, 24 Aug 2009 08:22:57 +0000 (10:22 +0200)
We don't want to descend into every subdirectory of a git repository
with a workdir.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
scan-tree.c

index 4da21a4cefe20aebac1498f24e39a5f64a4d70d4..67f4550ef8e0eec247527073c4fe7f670ba5f733 100644 (file)
@@ -89,6 +89,10 @@ static void scan_path(const char *base, const char *path)
                add_repo(base, path);
                return;
        }
+       if (is_git_dir(fmt("%s/.git", path))) {
+               add_repo(base, fmt("%s/.git", path));
+               return;
+       }
        dir = opendir(path);
        if (!dir) {
                fprintf(stderr, "Error opening directory %s: %s (%d)\n",