summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhostetler@github.com>2024-02-02 18:04:54 +0000
committerJunio C Hamano <gitster@pobox.com>2024-02-02 10:25:39 -0800
commit156e28b36d424a26b4548de636fa548b14defa71 (patch)
treecacd3886d2ac473af6e590a0c0564f9b197adac5 /builtin/commit.c
parentb8787a98dbef7b3b1cec9818b8856de557a65256 (diff)
sparse-index: pass string length to index_file_exists()
The call to index_file_exists() in the loop in expand_to_path() passes the wrong string length. Let's fix that. The loop in expand_to_path() searches the name-hash for each sub-directory prefix in the provided pathname. That is, by searching for "dir1/" then "dir1/dir2/" then "dir1/dir2/dir3/" and so on until it finds a cache-entry representing a sparse directory. The code creates "strbuf path_mutable" to contain the working pathname and modifies the buffer in-place by temporarily replacing the character following each successive "/" with NUL for the duration of the call to index_file_exists(). It does not update the strbuf.len during this substitution. Pass the patched length of the prefix path instead. Signed-off-by: Jeff Hostetler <jeffhostetler@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions