Merge branch 'rs/ls-tree-path-expansion-fix'

"git ls-tree --format='%(path) %(path)' $tree $path" showed the
path three times, which has been corrected.

* rs/ls-tree-path-expansion-fix:
  ls-tree: remove dead store and strbuf for quote_c_style()
  ls-tree: fix expansion of repeated %(path)
This commit is contained in:
Junio C Hamano
2023-01-23 13:39:50 -08:00
2 changed files with 10 additions and 7 deletions

View File

@@ -35,6 +35,12 @@ test_ls_tree_format () {
'
}
test_expect_success "ls-tree --format='%(path) %(path) %(path)' HEAD top-file" '
git ls-tree --format="%(path) %(path) %(path)" HEAD top-file.t >actual &&
echo top-file.t top-file.t top-file.t >expect &&
test_cmp expect actual
'
test_ls_tree_format \
"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
""