aboutsummaryrefslogtreecommitdiff
path: root/archive.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2009-01-25 01:52:05 +0100
committerJunio C Hamano <gitster@pobox.com>2009-02-07 12:14:34 -0800
commitd3bee161fef7820e83b44b899c531228a5546e87 (patch)
tree8d9d3d1beb916c3499045a2670cd8c0fd77a250c /archive.c
parent621f1b4bcf40f1469fc59202248df35619e33c82 (diff)
downloadgit-d3bee161fef7820e83b44b899c531228a5546e87.tar.gz
git-d3bee161fef7820e83b44b899c531228a5546e87.tar.xz
tree.c: allow read_tree_recursive() to traverse gitlink entries
When the callback function invoked from read_tree_recursive() returns the value `READ_TREE_RECURSIVE` for a gitlink entry, the traversal will now continue into the tree connected to the gitlinked commit. This functionality can be used to allow inter-repository operations, but since the current users of read_tree_recursive() does not yet support such operations, they have been modified where necessary to make sure that they never return READ_TREE_RECURSIVE for gitlink entries (hence no change in behaviour should be introduces by this patch alone). Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.c')
-rw-r--r--archive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/archive.c b/archive.c
index 9ac455d88..e6de0397c 100644
--- 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,