Merge branch 'maint-1.6.1' into maint
[gitweb.git] / archive.c
index 9ac455d889b72deba8c949da1d9efe2be3a50244..e6de0397cc82ae97018cbf4fc82d5697ec4d915d 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -132,7 +132,7 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
                err = write_entry(args, sha1, path.buf, path.len, mode, NULL, 0);
                if (err)
                        return err;
-               return READ_TREE_RECURSIVE;
+               return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
        }
 
        buffer = sha1_file_to_archive(path_without_prefix, sha1, mode,