MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / ShellQuoteSingle

Function ShellQuoteSingle

subprocess/subprocess.go:119–125  ·  view source on GitHub ↗

ShellQuoteSingle returns a string which is quoted suitably for sh.

(str string)

Source from the content-addressed store, hash-verified

117
118// ShellQuoteSingle returns a string which is quoted suitably for sh.
119func ShellQuoteSingle(str string) string {
120 // Quote anything that looks slightly complicated.
121 if shellWordRe.FindStringIndex(str) == nil {
122 return "'" + strings.Replace(str, "'", "'\\''", -1) + "'"
123 }
124 return str
125}
126
127// ShellQuote returns a copied string slice where each element is quoted
128// suitably for sh.

Callers 3

WorkerStartingMethod · 0.92
ShellQuoteFunction · 0.85
FormatPercentSequencesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected