Skip to content

Commit

Permalink
Fix use of single quotes when setting git username or email
Browse files Browse the repository at this point in the history
  • Loading branch information
bkneis authored and pascalbreuninger committed Dec 17, 2024
1 parent 3092dd6 commit 3151b8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/gitcredentials/gitcredentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func ToString(credentials *GitCredentials) string {

func SetUser(userName string, user *GitUser) error {
if user.Name != "" {
shellCommand := fmt.Sprintf("git config --global user.name '%s'", user.Name)
shellCommand := fmt.Sprintf(`git config --global user.name "%s"`, user.Name)
args := []string{}
if userName != "" {
args = append(args, "su", userName, "-c", shellCommand)
Expand All @@ -154,7 +154,7 @@ func SetUser(userName string, user *GitUser) error {
}
}
if user.Email != "" {
shellCommand := fmt.Sprintf("git config --global user.email '%s'", user.Email)
shellCommand := fmt.Sprintf(`git config --global user.email "%s"`, user.Email)
args := []string{}
if userName != "" {
args = append(args, "su", userName, "-c", shellCommand)
Expand Down

0 comments on commit 3151b8d

Please sign in to comment.