initRepoCommit temporarily changes with work directory.
(tmpPath string, sig *git.Signature)
| 942 | |
| 943 | // initRepoCommit temporarily changes with work directory. |
| 944 | func initRepoCommit(tmpPath string, sig *git.Signature) (err error) { |
| 945 | var stderr string |
| 946 | if _, stderr, err = process.ExecDir(-1, |
| 947 | tmpPath, fmt.Sprintf("initRepoCommit (git add): %s", tmpPath), |
| 948 | "git", "add", "--all"); err != nil { |
| 949 | return errors.Newf("git add: %s", stderr) |
| 950 | } |
| 951 | |
| 952 | if _, stderr, err = process.ExecDir(-1, |
| 953 | tmpPath, fmt.Sprintf("initRepoCommit (git commit): %s", tmpPath), |
| 954 | "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), |
| 955 | "-m", "Initial commit"); err != nil { |
| 956 | return errors.Newf("git commit: %s", stderr) |
| 957 | } |
| 958 | |
| 959 | if _, stderr, err = process.ExecDir(-1, |
| 960 | tmpPath, fmt.Sprintf("initRepoCommit (git push): %s", tmpPath), |
| 961 | "git", "push"); err != nil { |
| 962 | return errors.Newf("git push: %s", stderr) |
| 963 | } |
| 964 | return nil |
| 965 | } |
| 966 | |
| 967 | type CreateRepoOptionsLegacy struct { |
| 968 | Name string |
no test coverage detected