// Git is simple git command wrapper.
Git is simple git command wrapper.
// Git is simple git command wrapper .
func (this *GitPkg) Git(params ...string) (*exec.Cmd, error) {
	fullParams := append([]string{this.GitDir, this.WorkTree}, params...)
	cmd := exec.Command("git", fullParams...)
	stdout := bytes.Buffer{}
	stderr := bytes.Buffer{}
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	err := cmd.Run()
	if err != nil {
		err = fmt.Errorf("%s: git %s => %s", this.Name, strings.Join(params, " "), stderr.String())
		return cmd, err
	}
	return cmd, nil
}
func ( this * GitPkg ) Git ( params ... string ) ( * exec . Cmd , error ) { fullParams := append ( [ ] string { this . GitDir , this . WorkTree } , params ... ) cmd := exec . Command ( " " , fullParams ... ) stdout := bytes . Buffer { } stderr := bytes . Buffer { } cmd . Stdout = & stdout cmd . Stderr = & stderr err := cmd . Run ( ) if err != nil { err = fmt . Errorf ( " " , this . Name , strings . Join ( params , " " ) , stderr . String ( ) ) return cmd , err } return cmd , nil }
Git is simple git command wrapper.
Git is simple git command wrapper .