git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [WIP PATCH 20/26] bundle: move up gitdir setup to run_builtin()
Date: Tue, 16 Feb 2010 23:05:11 +0700	[thread overview]
Message-ID: <1266336317-607-21-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1266336317-607-1-git-send-email-pclouds@gmail.com>


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin-bundle.c |    6 ++----
 git.c            |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/builtin-bundle.c b/builtin-bundle.c
index 2006cc5..80649ba 100644
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
@@ -18,7 +18,6 @@ static const char builtin_bundle_usage[] =
 int cmd_bundle(int argc, const char **argv, const char *prefix)
 {
 	struct bundle_header header;
-	int nongit;
 	const char *cmd, *bundle_file;
 	int bundle_fd = -1;
 	char buffer[PATH_MAX];
@@ -31,7 +30,6 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 	argc -= 2;
 	argv += 2;
 
-	prefix = setup_git_directory_gently(&nongit);
 	if (prefix && bundle_file[0] != '/') {
 		snprintf(buffer, sizeof(buffer), "%s/%s", prefix, bundle_file);
 		bundle_file = buffer;
@@ -54,11 +52,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
 		return !!list_bundle_refs(&header, argc, argv);
 	}
 	if (!strcmp(cmd, "create")) {
-		if (nongit)
+		if (!startup_info->have_repository)
 			die("Need a repository to create a bundle.");
 		return !!create_bundle(&header, bundle_file, argc, argv);
 	} else if (!strcmp(cmd, "unbundle")) {
-		if (nongit)
+		if (!startup_info->have_repository)
 			die("Need a repository to unbundle.");
 		return !!unbundle(&header, bundle_fd) ||
 			list_bundle_refs(&header, argc, argv);
diff --git a/git.c b/git.c
index 96ccedd..9a85619 100644
--- a/git.c
+++ b/git.c
@@ -312,7 +312,7 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "bisect--helper", cmd_bisect__helper, RUN_SETUP | NEED_WORK_TREE },
 		{ "blame", cmd_blame, RUN_SETUP },
 		{ "branch", cmd_branch, RUN_SETUP },
-		{ "bundle", cmd_bundle },
+		{ "bundle", cmd_bundle, RUN_SETUP_GENTLY },
 		{ "cat-file", cmd_cat_file, RUN_SETUP },
 		{ "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
 		{ "checkout-index", cmd_checkout_index,
-- 
1.7.0.195.g637a2

  parent reply	other threads:[~2010-02-16 16:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 16:04 [WIP PATCH 00/26] Git setup cleanup series Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 01/26] rev-parse --git-dir: print relative gitdir correctly Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 02/26] setup_git_directory*: Explicitly set git dir Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 03/26] Save setup_git_dir* info globally for later use Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 04/26] Add GIT_HARDENED_SETUP to detect gitdir/worktree related mis-setup errors Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 05/26] enter_repo(): use setup_git_directory_gently internally Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 06/26] Tweak init/clone to work properly with GIT_HARDENED_SETUP=1 Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 07/26] Support running setup_git_dir_gently() from the beginning for builtin commands Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 08/26] config: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 09/26] hash-object: move " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 10/26] shortlog: move up " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 11/26] Do not look for .git/info/exclude when gitdir is not set up Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 12/26] grep: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 13/26] USE_PAGER should not be used without RUN_SETUP* Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 14/26] Do not try to read $GIT_DIR/info/attributes if there is no repository Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 15/26] archive: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 16/26] mailinfo: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 17/26] check-ref-format: setup gitdir gently Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 18/26] verify-pack: set up " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 19/26] apply: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` Nguyễn Thái Ngọc Duy [this message]
2010-02-16 16:05 ` [WIP PATCH 21/26] diff: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 22/26] help: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 23/26] ls-remote: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 24/26] var: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 25/26] merge-file: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 26/26] Turn on GIT_HARDENED_SETUP for the whole test suite Nguyễn Thái Ngọc Duy

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=1266336317-607-21-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /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).