Files
git/builtin
René Scharfe 16fb5c54bd 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>
2023-01-14 19:22:26 -08:00
..
2021-10-13 15:15:57 -07:00
2020-07-30 19:18:06 -07:00
2021-10-20 11:36:13 -07:00
2020-10-16 12:30:45 -07:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-07-28 13:17:59 -07:00
2020-03-24 15:04:43 -07:00
2021-11-12 15:29:25 -08:00
2021-11-10 15:01:20 -08:00
2021-10-23 10:45:25 -07:00
2021-10-13 15:15:58 -07:00
2021-04-14 13:47:21 -07:00
2021-09-28 10:31:02 -07:00
2020-03-24 15:04:44 -07:00
2021-10-25 16:06:58 -07:00
2021-10-18 15:47:57 -07:00
2020-07-30 19:18:06 -07:00
2020-08-11 18:04:11 -07:00