refactor: simplify ParseCatFileTreeLine and catBatchParseTreeEntries (#37210)

Simplify ParseCatFileTreeLine: it is faster without the preset buffers,
and easier to read and maintain.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Copilot
2026-04-14 12:03:26 +00:00
committed by GitHub
parent b55528b1a2
commit 84d5c99e64
6 changed files with 84 additions and 107 deletions

View File

@@ -46,7 +46,9 @@ func TestParseEntryMode(t *testing.T) {
{"160755", EntryModeCommit},
{"040000", EntryModeTree},
{"40000", EntryModeTree},
{"040755", EntryModeTree},
{"40755", EntryModeTree},
{"777777", EntryModeNoEntry}, // invalid mode
}