]> asedeno.scripts.mit.edu Git - git.git/blobdiff - dir.c
Merge branch 'master' of git://repo.or.cz/git/fastimport
[git.git] / dir.c
diff --git a/dir.c b/dir.c
index 7b91501255e69925629870e575f3a15286cb3f07..d3063520b03c9c5f608cbd9e97f6b414adb4c5af 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -34,8 +34,9 @@ int common_prefix(const char **pathspec)
        prefix = slash - path + 1;
        while ((next = *++pathspec) != NULL) {
                int len = strlen(next);
-               if (len >= prefix && !memcmp(path, next, len))
+               if (len >= prefix && !memcmp(path, next, prefix))
                        continue;
+               len = prefix - 1;
                for (;;) {
                        if (!len)
                                return 0;
@@ -375,6 +376,8 @@ static enum directory_treatment treat_directory(struct dir_struct *dir,
                return recurse_into_directory;
 
        case index_gitdir:
+               if (dir->show_other_directories)
+                       return ignore_directory;
                return show_directory;
 
        case index_nonexistent: