Make more commands work in subdirectory
PATCH 1/2 Make more commands work in subdirectory
count-objects, describe, merge-tree:
Call setup_git_directory() to make these commands work in subdirectory.
Signed-off-by Dmitry V. Levin <[email protected]>
--- describe.c | 2 ++ git.c | 2 +- merge-tree.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletions(-)
describe.c +2 -0
@@ -161,6 +161,8 @@ int main(int argc, char **argv)usage (describe_usage); } +setup_git_directory (); +if (i == argc)describe ("HEAD" ,1 );else
git.c +1 -1
@@ -224,7 +224,7 @@ static void handle_internal_command(int { "checkout-index", cmd_checkout_index, RUN_SETUP }, { "check-ref-format", cmd_check_ref_format }, { "commit-tree", cmd_commit_tree, RUN_SETUP }, - { "count-objects", cmd_count_objects }, + { "count-objects", cmd_count_objects, RUN_SETUP }, { "diff", cmd_diff, RUN_SETUP }, { "diff-files", cmd_diff_files, RUN_SETUP }, { "diff-index", cmd_diff_index, RUN_SETUP },
merge-tree.c +2 -0
@@ -340,6 +340,8 @@ int main(int argc, char **argv)if (argc <4 )usage (merge_tree_usage); +setup_git_directory (); + buf1 =get_tree_descriptor (t+0 , argv[1 ]); buf2 =get_tree_descriptor (t+1 , argv[2 ]); buf3 =get_tree_descriptor (t+2 , argv[3 ]);
Signature · 1 line
ldv