X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-ls-tree.c;h=5b63e6eada5cd6de764acef694da624a70ce6dab;hb=bee6ea17a1bab824eba6133eefc3c70b219ec98c;hp=d25767a1f7eb0a8b45bc1eed6b9aa95de0847f18;hpb=392f1300911120fbaa4b77c737fe13e205726aca;p=git.git diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c index d25767a1f..5b63e6ead 100644 --- a/builtin-ls-tree.c +++ b/builtin-ls-tree.c @@ -23,7 +23,7 @@ static int chomp_prefix; static const char *ls_tree_prefix; static const char ls_tree_usage[] = - "git ls-tree [-d] [-r] [-t] [-l] [-z] [--name-only] [--name-status] [--full-name] [--abbrev[=]] [path...]"; + "git ls-tree [-d] [-r] [-t] [-l] [-z] [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev[=]] [path...]"; static int show_recursive(const char *base, int baselen, const char *pathname) { @@ -66,17 +66,16 @@ static int show_tree(const unsigned char *sha1, const char *base, int baselen, /* * Maybe we want to have some recursive version here? * - * Something like: + * Something similar to this incomplete example: * if (show_subprojects(base, baselen, pathname)) { - if (fork()) { - chdir(base); - exec ls-tree; - } - waitpid(); + struct child_process ls_tree; + + ls_tree.dir = base; + ls_tree.argv = ls-tree; + start_command(&ls_tree); } * - * ..or similar.. */ type = commit_type; } else if (S_ISDIR(mode)) { @@ -157,6 +156,11 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix) chomp_prefix = 0; break; } + if (!strcmp(argv[1]+2, "full-tree")) { + ls_tree_prefix = prefix = NULL; + chomp_prefix = 0; + break; + } if (!prefixcmp(argv[1]+2, "abbrev=")) { abbrev = strtoul(argv[1]+9, NULL, 10); if (abbrev && abbrev < MINIMUM_ABBREV)