unsetGitConf removes the core.hooksPath entry from git config (local or global).
(isGlobal bool)
| 40 | |
| 41 | // unsetGitConf removes the core.hooksPath entry from git config (local or global). |
| 42 | func unsetGitConf(isGlobal bool) error { |
| 43 | args := []string{"config"} |
| 44 | if isGlobal { |
| 45 | args = append(args, "--global") |
| 46 | } |
| 47 | args = append(args, "--unset", "core.hooksPath") |
| 48 | |
| 49 | cmd := exec.Command("git", args...) |
| 50 | cmd.Stderr = os.Stderr |
| 51 | return cmd.Run() |
| 52 | } |
| 53 | |
| 54 | // promptConfirm prints prompt and waits for the user to type y/yes or anything else. |
| 55 | // Returns true only when the user confirms with "y" or "yes" (case-insensitive). |