git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Junio C Hamano <junkio@cox.net>
Cc: GIT mailing list <git@vger.kernel.org>
Subject: [PATCH 1/2] Make more commands work in subdirectory
Date: Thu, 14 Sep 2006 05:03:59 +0400	[thread overview]
Message-ID: <20060914010359.GA20593@nomad.office.altlinux.org> (raw)

count-objects, describe, merge-tree:
	Call setup_git_directory() to make these commands work in subdirectory.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 describe.c   |    2 ++
 git.c        |    2 +-
 merge-tree.c |    2 ++
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/describe.c b/describe.c
index 5dd8b2e..5ed052d 100644
--- a/describe.c
+++ b/describe.c
@@ -161,6 +161,8 @@ int main(int argc, char **argv)
 			usage(describe_usage);
 	}
 
+	setup_git_directory();
+
 	if (i == argc)
 		describe("HEAD", 1);
 	else
diff --git a/git.c b/git.c
index 335f405..47c85e1 100644
--- a/git.c
+++ b/git.c
@@ -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 },
diff --git a/merge-tree.c b/merge-tree.c
index 60df758..c154dcf 100644
--- a/merge-tree.c
+++ b/merge-tree.c
@@ -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]);


-- 
ldv

                 reply	other threads:[~2006-09-14  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060914010359.GA20593@nomad.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).