diff options
| author | 2026-03-04 08:26:56 +0800 | |
|---|---|---|
| committer | 2026-03-04 08:59:53 +0800 | |
| commit | ab7501be34032fb9e5c48726a68ae90a917af9eb (patch) | |
| tree | 20d005647569befea8133e953c3270e8fd2a2a5b /diff/trees/path.go | |
| parent | *: gofumpt (diff) | |
| signature | No signature | |
*: Lint
Diffstat (limited to 'diff/trees/path.go')
| -rw-r--r-- | diff/trees/path.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/diff/trees/path.go b/diff/trees/path.go index 0ced379a..e40f3de5 100644 --- a/diff/trees/path.go +++ b/diff/trees/path.go @@ -4,11 +4,14 @@ func joinPath(prefix, name []byte) []byte { if len(prefix) == 0 { out := make([]byte, len(name)) copy(out, name) + return out } + out := make([]byte, len(prefix)+1+len(name)) copy(out, prefix) out[len(prefix)] = '/' copy(out[len(prefix)+1:], name) + return out } |
