summaryrefslogtreecommitdiff
path: root/builtin/bundle.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-08-06 03:12:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-16 02:57:33 (GMT)
commit2cb60093e6c6b53cfc8ffe75f697386a1adab778 (patch)
tree43c4e669242644580daf10fe2b34b3fbdd156932 /builtin/bundle.c
parentd1ea896290629185dc0bf4efa3469b410bd41313 (diff)
downloadgit-2cb60093e6c6b53cfc8ffe75f697386a1adab778.zip
git-2cb60093e6c6b53cfc8ffe75f697386a1adab778.tar.gz
git-2cb60093e6c6b53cfc8ffe75f697386a1adab778.tar.bz2
bundle: run setup_git_directory_gently() sooner
Without this change, “git -p bundle” does not always respect the repository-local “[core] pager” setting. It is hard to notice because subcommands other than “git bundle unbundle” do not produce much output. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/bundle.c')
-rw-r--r--builtin/bundle.c6
1 files changed, 2 insertions, 4 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);