diff options
Diffstat (limited to 'vendor/github.com/libgit2/git2go/ignore.go')
-rw-r--r-- | vendor/github.com/libgit2/git2go/ignore.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/vendor/github.com/libgit2/git2go/ignore.go b/vendor/github.com/libgit2/git2go/ignore.go deleted file mode 100644 index c698de11a..000000000 --- a/vendor/github.com/libgit2/git2go/ignore.go +++ /dev/null @@ -1,54 +0,0 @@ -package git - -/* -#include <git2.h> -*/ -import "C" -import ( - "runtime" - "unsafe" -) - -func (v *Repository) AddIgnoreRule(rules string) error { - crules := C.CString(rules) - defer C.free(unsafe.Pointer(crules)) - - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - ret := C.git_ignore_add_rule(v.ptr, crules) - runtime.KeepAlive(v) - if ret < 0 { - return MakeGitError(ret) - } - return nil -} - -func (v *Repository) ClearInternalIgnoreRules() error { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - ret := C.git_ignore_clear_internal_rules(v.ptr) - runtime.KeepAlive(v) - if ret < 0 { - return MakeGitError(ret) - } - return nil -} - -func (v *Repository) IsPathIgnored(path string) (bool, error) { - var ignored C.int - - cpath := C.CString(path) - defer C.free(unsafe.Pointer(cpath)) - - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - ret := C.git_ignore_path_is_ignored(&ignored, v.ptr, cpath) - runtime.KeepAlive(v) - if ret < 0 { - return false, MakeGitError(ret) - } - return ignored == 1, nil -} |