summaryrefslogtreecommitdiff
path: root/t/t5318-commit-graph.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-06-18 18:14:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-20 03:46:27 (GMT)
commit16110c9348fc2022e78f2581968cf428c056dc5b (patch)
tree0bf8c25303b5893adc12a8ed3deb23ca3d94ee81 /t/t5318-commit-graph.sh
parenta09c1301ce5986a374ab008b2125fa26a9bdd2fe (diff)
downloadgit-16110c9348fc2022e78f2581968cf428c056dc5b.zip
git-16110c9348fc2022e78f2581968cf428c056dc5b.tar.gz
git-16110c9348fc2022e78f2581968cf428c056dc5b.tar.bz2
commit-graph: normalize commit-graph filenames
When writing commit-graph files, we append path data to an object directory, which may be specified by the user via the '--object-dir' option. If the user supplies a trailing slash, or some other alternative path format, the resulting path may be usable for writing to the correct location. However, when expiring graph files from the <obj-dir>/info/commit-graphs directory during a write, we need to compare paths with exact string matches. Normalize the commit-graph filenames to avoid ambiguity. This creates extra allocations, but this is a constant multiple of the number of commit-graph files, which should be a number in the single digits. Further normalize the object directory in the context. Due to a comparison between g->obj_dir and ctx->obj_dir in split_graph_merge_strategy(), a trailing slash would prevent any merging of layers within the same object directory. The check is there to ensure we do not merge across alternates. Update the tests to include a case with this trailing slash problem. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5318-commit-graph.sh')
0 files changed, 0 insertions, 0 deletions