Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of libgit2 built without thread support #918

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion git.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"bytes"
"encoding/hex"
"errors"
"os"
"runtime"
"strings"
"unsafe"
Expand Down Expand Up @@ -148,7 +149,7 @@ func initLibGit2() {
// with multi-threading support. The most likely outcome is a segfault
// or panic at an incomprehensible time, so let's make it easy by
// panicking right here.
if features&FeatureThreads == 0 {
if features&FeatureThreads == 0 && !strings.EqualFold(os.Getenv("ALLOW_THREADLESS_LIBGIT2"), "true") {
panic("libgit2 was not built with threading support")
}

Expand Down