diff options
| author | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
| commit | a026bde1ac84f90f0b82faa18890b2023c5198d5 (patch) | |
| tree | 8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /builtin/bundle.c | |
| parent | Merge branch 'jc/lint-runaway-here-doc' (diff) | |
| parent | bundle: use prefix_filename with bundle path (diff) | |
| download | git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz git-a026bde1ac84f90f0b82faa18890b2023c5198d5.zip | |
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.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c index 4883a435a9..d0de59b94f 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) |
