X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-tree.c;h=cb61717685b09a2e409440206e27fce68831e04d;hb=36c079756f9f3ad0bbbe2097550c62427670146b;hp=7abe333ce99a3448373119c1a811341cb15f1d10;hpb=ada59fcd3230e661bc1110702a2fb4ef76371bc1;p=git.git diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c index 7abe333ce..cb6171768 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] [--abbrev[=]] [path...]"; static int show_recursive(const char *base, int baselen, const char *pathname) { @@ -56,7 +56,7 @@ static int show_recursive(const char *base, int baselen, const char *pathname) } static int show_tree(const unsigned char *sha1, const char *base, int baselen, - const char *pathname, unsigned mode, int stage) + const char *pathname, unsigned mode, int stage, void *context) { int retval = 0; const char *type = blob_type; @@ -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)) { @@ -122,7 +121,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix) unsigned char sha1[20]; struct tree *tree; - git_config(git_default_config); + git_config(git_default_config, NULL); ls_tree_prefix = prefix; if (prefix && *prefix) chomp_prefix = strlen(prefix); @@ -189,7 +188,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix) tree = parse_tree_indirect(sha1); if (!tree) die("not a tree object"); - read_tree_recursive(tree, "", 0, 0, pathspec, show_tree); + read_tree_recursive(tree, "", 0, 0, pathspec, show_tree, NULL); return 0; }