Skip to content

Commit

Permalink
Make count-objects, describe and merge-tree work in subdirectory
Browse files Browse the repository at this point in the history
Call setup_git_directory() to make these commands work in subdirectory.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Dmitry V. Levin authored and Junio C Hamano committed Sep 14, 2006
1 parent 551029a commit 8112894
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ int main(int argc, char **argv)
usage(describe_usage);
}

setup_git_directory();

if (i == argc)
describe("HEAD", 1);
else
Expand Down
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "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 },
Expand Down
2 changes: 2 additions & 0 deletions merge-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 8112894

Please sign in to comment.