func (g *gitCmd) Exec(dir string) error {
	g.Lock()
	g.dir = dir
	g.Unlock()

	if g.background {
		return g.execBackground(dir)
	}
	return g.exec(dir)
}
func (g *gitCmd) Exec(dir string) error {
	g.Lock()
	g.dir = dir
	g.Unlock()

	if g.background {
		return g.execBackground(dir)
	}
	return g.exec(dir)
}
func ( g * gitCmd ) Exec ( dir string ) error { g . Lock ( ) g . dir = dir g . Unlock ( ) if g . background { return g . execBackground ( dir ) } return g . exec ( dir ) }
// Exec executes the command initiated in gitCmd.
Exec executes the command initiated in gitCmd .