]> git.ipfire.org Git - thirdparty/git.git/commit
worktree: refactor infer_backlink() to use *strbuf
authorCaleb White <cdwhite3@pm.me>
Tue, 8 Oct 2024 03:12:30 +0000 (22:12 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Oct 2024 18:49:21 +0000 (11:49 -0700)
commitbb4a883584ab13500921325617e022142633e53a
treef635de881598909c840697a3aec21f5f4d360a3e
parent58d8805de246352b41ca7bfd6cd70078b94ff1f1
worktree: refactor infer_backlink() to use *strbuf

This lays the groundwork for the next patch, which needs the backlink
returned from infer_backlink() as a `strbuf`. It seemed inefficient to
convert from `strbuf` to `char*` and back to `strbuf` again.

This refactors infer_backlink() to return an integer result and use a
pre-allocated `strbuf` for the inferred backlink path, replacing the
previous `char*` return type and improving efficiency.

Signed-off-by: Caleb White <cdwhite3@pm.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c