aboutsummaryrefslogtreecommitdiffstats
path: root/git.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-01-14 15:37:53 +0100
committerJunio C Hamano <gitster@pobox.com>2023-01-14 19:22:26 -0800
commit16fb5c54bd91c9714e12c6d742e5a6fd81459b71 (patch)
tree0247f5b7dfa8a6ffa4bf13f7801ba420545da6f3 /git.c
parentls-tree: introduce "--format" option (diff)
downloadgit-16fb5c54bd91c9714e12c6d742e5a6fd81459b71.tar.gz
git-16fb5c54bd91c9714e12c6d742e5a6fd81459b71.zip
ls-tree: fix expansion of repeated %(path)
expand_show_tree() borrows the base strbuf given to us by read_tree() to build the full path of the current entry when handling %(path). Only its indirect caller, show_tree_fmt(), removes the added entry name. That works fine as long as %(path) is only included once in the format string, but accumulates duplicates if it's repeated: $ git ls-tree --format='%(path) %(path) %(path)' HEAD M* Makefile MakefileMakefile MakefileMakefileMakefile Reset the length after each use to get the same expansion every time; here's the behavior with this patch: $ ./git ls-tree --format='%(path) %(path) %(path)' HEAD M* Makefile Makefile Makefile Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
0 files changed, 0 insertions, 0 deletions