diff --git a/Build_bundled_static.go b/Build_bundled_static.go index 4d10d45..65e31ac 100644 --- a/Build_bundled_static.go +++ b/Build_bundled_static.go @@ -4,7 +4,7 @@ package git /* #cgo windows CFLAGS: -I${SRCDIR}/static-build/install/include/ -#cgo windows LDFLAGS: -L${SRCDIR}/static-build/install/lib/ -lgit2 -lwinhttp +#cgo windows LDFLAGS: -L${SRCDIR}/static-build/install/lib/ -lgit2 -lwinhttp -lws2_32 -lole32 -lrpcrt4 -lcrypt32 #cgo !windows pkg-config: --static ${SRCDIR}/static-build/install/lib/pkgconfig/libgit2.pc #cgo CFLAGS: -DLIBGIT2_STATIC #include diff --git a/repository.go b/repository.go index cb82fc3..a6eb7f1 100644 --- a/repository.go +++ b/repository.go @@ -739,39 +739,5 @@ func (r *Repository) RemoveMessage() error { if cErr < 0 { return MakeGitError(cErr) } - return nil -} - -type RepositoryItem int - -const ( - RepositoryItemGitDir RepositoryItem = C.GIT_REPOSITORY_ITEM_GITDIR - RepositoryItemWorkDir RepositoryItem = C.GIT_REPOSITORY_ITEM_WORKDIR - RepositoryItemCommonDir RepositoryItem = C.GIT_REPOSITORY_ITEM_COMMONDIR - RepositoryItemIndex RepositoryItem = C.GIT_REPOSITORY_ITEM_INDEX - RepositoryItemObjects RepositoryItem = C.GIT_REPOSITORY_ITEM_OBJECTS - RepositoryItemRefs RepositoryItem = C.GIT_REPOSITORY_ITEM_REFS - RepositoryItemPackedRefs RepositoryItem = C.GIT_REPOSITORY_ITEM_PACKED_REFS - RepositoryItemRemotes RepositoryItem = C.GIT_REPOSITORY_ITEM_REMOTES - RepositoryItemConfig RepositoryItem = C.GIT_REPOSITORY_ITEM_CONFIG - RepositoryItemInfo RepositoryItem = C.GIT_REPOSITORY_ITEM_INFO - RepositoryItemHooks RepositoryItem = C.GIT_REPOSITORY_ITEM_HOOKS - RepositoryItemLogs RepositoryItem = C.GIT_REPOSITORY_ITEM_LOGS - RepositoryItemModules RepositoryItem = C.GIT_REPOSITORY_ITEM_MODULES - RepositoryItemWorkTrees RepositoryItem = C.GIT_REPOSITORY_ITEM_WORKTREES -) - -func (r *Repository) ItemPath(item RepositoryItem) (string, error) { - var c_buf C.git_buf - defer C.git_buf_dispose(&c_buf) - - runtime.LockOSThread() - defer runtime.UnlockOSThread() - - ret := C.git_repository_item_path(&c_buf, r.ptr, C.git_repository_item_t(item)) - runtime.KeepAlive(r) - if ret < 0 { - return "", MakeGitError(ret) - } - return C.GoString(c_buf.ptr), nil + return nil } diff --git a/repository_test.go b/repository_test.go index e403aa9..5a0f920 100644 --- a/repository_test.go +++ b/repository_test.go @@ -92,14 +92,3 @@ func TestRepositorySetConfig(t *testing.T) { t.Fatal("result must be true") } } - -func TestRepositoryItemPath(t *testing.T) { - repo := createTestRepo(t) - defer cleanupTestRepo(t, repo) - - gitDir, err := repo.ItemPath(RepositoryItemGitDir) - checkFatal(t, err) - if gitDir == "" { - t.Error("expected not empty gitDir") - } -}