summaryrefslogtreecommitdiff
path: root/builtin/bundle.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:26 (GMT)
commita026bde1ac84f90f0b82faa18890b2023c5198d5 (patch)
tree8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /builtin/bundle.c
parent09fb53568e3e00e30891b118045aa07ede524103 (diff)
parent3b754eedd58636926d07b14a34799a3aa7b8ebc2 (diff)
downloadgit-a026bde1ac84f90f0b82faa18890b2023c5198d5.zip
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz
git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.bz2
Merge branch 'jk/prefix-filename'
Code clean-up with minor bugfixes. * jk/prefix-filename: bundle: use prefix_filename with bundle path prefix_filename: simplify windows #ifdef prefix_filename: return newly allocated string prefix_filename: drop length parameter prefix_filename: move docstring to header file hash-object: fix buffer reuse with --path in a subdirectory
Diffstat (limited to 'builtin/bundle.c')
-rw-r--r--builtin/bundle.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 4883a43..d0de59b 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -20,21 +20,15 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
struct bundle_header header;
const char *cmd, *bundle_file;
int bundle_fd = -1;
- char buffer[PATH_MAX];
if (argc < 3)
usage(builtin_bundle_usage);
cmd = argv[1];
- bundle_file = argv[2];
+ bundle_file = prefix_filename(prefix, argv[2]);
argc -= 2;
argv += 2;
- if (prefix && bundle_file[0] != '/') {
- snprintf(buffer, sizeof(buffer), "%s/%s", prefix, bundle_file);
- bundle_file = buffer;
- }
-
memset(&header, 0, sizeof(header));
if (strcmp(cmd, "create") && (bundle_fd =
read_bundle_header(bundle_file, &header)) < 0)