Example #1
0
func NewConfig() (*Config, error) {
	cfg := new(Config)
	ecode := C.git_config_new(&cfg.git_config)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return cfg, nil
}
Example #2
0
File: config.go Project: wid/git2go
// NewConfig creates a new empty configuration object
func NewConfig() (*Config, error) {
	config := new(Config)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	if ret := C.git_config_new(&config.ptr); ret < 0 {
		return nil, MakeGitError(ret)
	}

	return config, nil
}