X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fbundle.c;h=92a8a6026a9bd6da5394e7b37f07dbe91f73db9c;hb=8ced9c90a28f6abc80dc5ad4cf7921c2322c0bb0;hp=2006cc5cd5cc4d381189f5cf7bdd09fcdd66b9ca;hpb=03f94ae9f909952ed5a78917ab319a312889354b;p=git.git diff --git a/builtin/bundle.c b/builtin/bundle.c index 2006cc5cd..92a8a6026 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -12,13 +12,12 @@ static const char builtin_bundle_usage[] = "git bundle create \n" " or: git bundle verify \n" - " or: git bundle list-heads [refname...]\n" - " or: git bundle unbundle [refname...]"; + " or: git bundle list-heads [...]\n" + " or: git bundle unbundle [...]"; 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; @@ -46,7 +44,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix) close(bundle_fd); if (verify_bundle(&header, 1)) return 1; - fprintf(stderr, "%s is okay\n", bundle_file); + fprintf(stderr, _("%s is okay\n"), bundle_file); return 0; } if (!strcmp(cmd, "list-heads")) { @@ -54,13 +52,13 @@ int cmd_bundle(int argc, const char **argv, const char *prefix) return !!list_bundle_refs(&header, argc, argv); } if (!strcmp(cmd, "create")) { - if (nongit) - die("Need a repository to create a bundle."); + 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) - die("Need a repository to unbundle."); - return !!unbundle(&header, bundle_fd) || + if (!startup_info->have_repository) + die(_("Need a repository to unbundle.")); + return !!unbundle(&header, bundle_fd, 0) || list_bundle_refs(&header, argc, argv); } else usage(builtin_bundle_usage);