nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: twpayne/chezmoi
Pull request #515 (2019-12-13 17:38:35)

Don't quote shell args just because of equals signs


Patch:
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index dfed3bca2..f9008c75d 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -24,7 +24,7 @@ Install chezmoi with a single command.
 | ------------ | ---------- | ------------------------------------------------------------------------------------------- |
 | Linux        | snap       | `snap install chezmoi --classic`                                                            |
 | Linux        | Linuxbrew  | `brew install twpayne/taps/chezmoi`                                                         |
-| Alpine Linux | apk        | `apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ chezmoi`         |
+| Alpine Linux | apk        | `apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ chezmoi`           |
 | Arch Linux   | pacman     | `pacman -S chezmoi`                                                                         |
 | macOS        | Homebrew   | `brew install twpayne/taps/chezmoi`                                                         |
 | Windows      | Scoop      | `scoop bucket add twpayne https://github.com/twpayne/scoop-bucket && scoop install chezmoi` |
diff --git a/internal/chezmoi/maybeshellquote.go b/internal/chezmoi/maybeshellquote.go
index 2491086f4..6d527d16f 100644
--- a/internal/chezmoi/maybeshellquote.go
+++ b/internal/chezmoi/maybeshellquote.go
@@ -5,7 +5,7 @@ import (
 	"strings"
 )
 
-var needShellQuoteRegexp = regexp.MustCompile(`[^+\-./0-9A-Z_a-z]`)
+var needShellQuoteRegexp = regexp.MustCompile(`[^+\-./0-9=A-Z_a-z]`)
 
 const (
 	backslash   = '\\'


Test patch:
diff --git a/internal/chezmoi/maybeshellquote_test.go b/internal/chezmoi/maybeshellquote_test.go
index 30c2dbc16..cb145721c 100644
--- a/internal/chezmoi/maybeshellquote_test.go
+++ b/internal/chezmoi/maybeshellquote_test.go
@@ -8,16 +8,18 @@ import (
 
 func TestMaybeShellQuote(t *testing.T) {
 	for s, expected := range map[string]string{
-		``:    `''`,
-		`'`:   `\'`,
-		`''`:  `\'\'`,
-		`'a'`: `\''a'\'`,
-		`\`:   `'\\'`,
-		`\a`:  `'\\a'`,
-		`$a`:  `'$a'`,
-		`a`:   `a`,
-		`a/b`: `a/b`,
-		`a b`: `'a b'`,
+		``:            `''`,
+		`'`:           `\'`,
+		`''`:          `\'\'`,
+		`'a'`:         `\''a'\'`,
+		`\`:           `'\\'`,
+		`\a`:          `'\\a'`,
+		`$a`:          `'$a'`,
+		`a`:           `a`,
+		`a/b`:         `a/b`,
+		`a b`:         `'a b'`,
+		`--arg`:       `--arg`,
+		`--arg=value`: `--arg=value`,
 	} {
 		assert.Equal(t, expected, MaybeShellQuote(s), "quoting %q", s)
 	}