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>
This commit is contained in:
committed by
Junio C Hamano
parent
621f1b4bcf
commit
d3bee161fe
@ -237,7 +237,7 @@ static int save_files_dirs(const unsigned char *sha1,
|
||||
string_list_insert(newpath, &o->current_file_set);
|
||||
free(newpath);
|
||||
|
||||
return READ_TREE_RECURSIVE;
|
||||
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
|
||||
}
|
||||
|
||||
static int get_files_dirs(struct merge_options *o, struct tree *tree)
|
||||
|
||||
Reference in New Issue
Block a user