summaryrefslogtreecommitdiff
path: root/Documentation/gittutorial.txt
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2017-03-20 21:31:27 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-21 11:18:41 -0700
commit3b754eedd58636926d07b14a34799a3aa7b8ebc2 (patch)
tree4019a9f90e18676fe1cf6f1df37f8b67df0e5754 /Documentation/gittutorial.txt
parentprefix_filename: simplify windows #ifdef (diff)
downloadtgif-3b754eedd58636926d07b14a34799a3aa7b8ebc2.tar.xz
bundle: use prefix_filename with bundle path
We may take the path to a bundle file as an argument, and need to adjust the filename based on the prefix we discovered while setting up the git directory. We do so manually into a fixed-size buffer, but using prefix_filename() is the normal way. Besides being more concise, there are two subtle improvements: 1. The original inserted a "/" between the two paths, even though the "prefix" argument always has the "/" appended. That means that: cd subdir && git bundle verify ../foo.bundle was looking at (and reporting) subdir//../foo.bundle. Harmless, but ugly. Using prefix_filename() gets this right. 2. The original checked for an absolute path by looking for a leading '/'. It should have been using is_absolute_path(), which also covers more cases on Windows (backslashes and dos drive prefixes). But it's easier still to just pass the name to prefix_filename(), which handles this case automatically. Note that we'll just leak the resulting buffer in the name of simplicity, since it needs to last through the duration of the program anyway. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gittutorial.txt')
0 files changed, 0 insertions, 0 deletions