MCPcopy Create free account
hub / github.com/libgit2/git2go / AddGitIgnoreRules

Method AddGitIgnoreRules

repository.go:782–794  ·  view source on GitHub ↗
(rules string)

Source from the content-addressed store, hash-verified

780}
781
782func (r *Repository) AddGitIgnoreRules(rules string) error {
783 runtime.LockOSThread()
784 defer runtime.UnlockOSThread()
785
786 crules := C.CString(rules)
787 defer C.free(unsafe.Pointer(crules))
788 ret := C.git_ignore_add_rule(r.ptr, crules)
789 runtime.KeepAlive(r)
790 if ret < 0 {
791 return MakeGitError(ret)
792 }
793 return nil
794}
795
796func (r *Repository) ClearGitIgnoreRules() error {
797 runtime.LockOSThread()

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected