MCPcopy Create free account
hub / github.com/antonmedv/gitmal / quoteByte

Function quoteByte

pkg/gitdiff/format.go:71–84  ·  view source on GitHub ↗
(b byte)

Source from the content-addressed store, hash-verified

69}
70
71func quoteByte(b byte) ([]byte, bool) {
72 if q, ok := quoteEscapeTable[b]; ok {
73 return []byte{'\\', q}, true
74 }
75 if b < 0x20 || b >= 0x7F {
76 return []byte{
77 '\\',
78 '0' + (b>>6)&0o3,
79 '0' + (b>>3)&0o7,
80 '0' + (b>>0)&0o7,
81 }, true
82 }
83 return nil, false
84}
85
86func (fm *formatter) FormatFile(f *File) {
87 fm.WriteString("diff --git ")

Callers 1

WriteQuotedNameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected