summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-25Fix installation of libgit2 into wrong libdir (#624)Patrick Steinhardt
Upstream libgit2 has migrated to use the GNUInstallDirs module to decide where things will be installed to by default. While it improves consistency with the host system, we're not really after that when building the vendored libgit2 library, and in fact libgit2.{a,pc} may now be installed into a different directory than before as it started to depend on the host platform. Fix this by explicitly specifying that we want the library and pkgconfig file to be installed into a plain "lib/" directory.
2020-07-10FetchOptions: add ability to specify ProxyOptions (#623)Jesse Hathaway
Prior to this change you could not specifiy proxy options on the FetchOptions struct, which made it impossible to specify a proxy for an initial clone. This change adds the ProxyOptions to the FetchOptions struct so you can go through a proxy when cloning.
2020-06-21Revamp the ways in which the library can be built (#621)lhchavez
This change allows to link the system version of libgit2 statically. Since `-tags static` is already used for the bundled version of the library and to avoid breaking old workflows, `-tags static,system_libgit2` is now used to select that. This means that the valid combinations are: | Flag | Effect | |-------------------------------|-----------------------------------------------| | _No flags_ | Dynamically-linked against the system libgit2 | | `-tags static,system_libgit2` | Statically-linked against the system libgit2 | | `-tags static` | Statically-linked against the bundled libgit2 | Note that there is no way to express dynamically linking against the bundled libgit2 because that makes very little sense, since the binaries wouldn't be able to be distributed. If that's still desired, the `PKG_CONFIG_PATH` environment variable can set before building the code. [`Makefile`](https://github.com/libgit2/git2go/blob/master/Makefile) has an example of how it is used in the CI.
2020-06-21Fix a potential use-after-free in DiffNotifyCallback (#579)lhchavez
This change makes the DiffNotifyCallback always use an "unowned" *git.Diff that does _not_ run the finalizer. Since the underlying git_diff object is still owned by libgit2, we shouldn't be calling Diff.Free() on it, even by accident, since that would cause a whole lot of undefined behavior. Now instead of storing a reference to a *git.Diff in the intermediate state while the diff operation is being done, create a brand new *git.Diff for every callback invocation, and only create a fully-owned *git.Diff when the diff operation is done and the ownership is transfered to Go.
2020-06-21Add a way to cleanly shut down the library (#578)lhchavez
This change adds the Shutdown() method, so that the library can be cleanly shut down. This helps significanly reduce the amount of noise in the leak detector.
2020-06-20Update the `README.md` to clarify some aspects of static libgit2 (#620)lhchavez
This change improves the documentation surrounding libgit2 static builds and modules. Fixes: #618
2020-06-20Remove a couple of now-unnecessary CMake defines (#619)lhchavez
This change removes the `LIB_INSTALL_DIR` and `INCLUDE_INSTALL_DIR` from the `script/build-libgit2.sh` script, since they are now unneeded and just print a warning if they are used.
2020-06-04Provide missing merge flags (#615)Takuji Shimokawa
This change adds two missing merge flags MergeTreeSkipREUC and MergeTreeNoRecursive.
2020-06-02Add support for parsing git trailers (#614)Jesse Hathaway
Adds a wrapper for git_message_trailers which returns a slice of trailer structs.
2020-05-09Merge pull request #582 from suhaibmujahid/method-renamelhchavez
It is not Go idiomatic to put Get into the getter's name
2020-05-09refactor: Rename methods with Get prefixSuhaib Mujahid
It is not Go idiomatic to put Get into the getter's name. https: //golang.org/doc/effective_go.html#Getters Co-Authored-By: lhchavez <[email protected]>
2020-05-04expose options related to cachinglhchavez
2020-05-04cache_opts: address PR commentsVladimir Buzuev
2020-04-23Check nil signatureSuhaib Mujahid
2020-04-03expose options related to cachingVladimir Buzuev
2020-04-02Uprev vendor/libgit2 to v1.0lhchavez
This uprevs libgit2 to the latest and greatest.
2020-03-26Fix SIGSEGV on double free for Cred objectlhchavez
This change removes the Go finalizer when passing ownership to libgit2. Fixes: #553
2020-03-26clear native cred pointer after transfer ownership to libgitVladimir Buzuev
2020-03-26fix SIGSERV on double free for Cred objectVladimir Buzuev
2020-03-23Update README.mdSuhaib Mujahid
2020-03-19Update README.mdlhchavez
Clarifying the versions since we're using Go 1.11 module version rules now.
2020-03-19Add the version number to go.modlhchavez
This is the second take on trying to tag the current release with a Go version.
2020-03-04Uprev vendor/libgit2 to v0.99lhchavez
This uprevs libgit2 to the latest and greatest.
2020-02-27Merge pull request #542 from slyphon/fix-error-namelhchavez
Resolves issue #541 - typo in error code 'ErrAmbigious'
2020-02-27Resolves issue #541 - typo in error code 'ErrAmbigious'Jonathan Simms
I've added an additional constant with the correct spelling. I did this rather than removing the existing constant to avoid breaking existing code with the misspelled name.
2020-02-23Fix the DiffFlag typelhchavez
This change makes the underlying type of DiffFlag be uint32 instead of int. That makes it possible to build on 32-bit systems. Fixes: #487
2020-02-23Add odb.NewOdbBackendLoose()lhchavez
This change adds support for odb.NewOdbBackendLoose(). This, together with the git.Packbuilder, can do what Mempack does with a lot less memory.
2020-02-23Add support for indexers and alternate odb packfileslhchavez
This allows for implementations of git servers written in Go.
2020-02-23Fix the Cred interfacelhchavez
This change adds Cred.Free() and finalizers to prevent memory leaks. It also makes the interface for Cred more idiomatic and return actual errors intead of ints.
2020-02-23Merge pull request #429 from josharian/cherrypick-commitlhchavez
cherrypick: wrap git_cherrypick_commit
2020-02-23Add testlhchavez
2020-02-23Merge remote-tracking branch 'upstream/master' into cherrypick-commitlhchavez
2020-02-23Merge pull request #423 from josharian/more-annotated-commitlhchavez
merge: add two missing AnnotatedCommit methods
2020-02-23Add test and runtime.KeepAlive()lhchavez
2020-02-23Merge remote-tracking branch 'upstream/master' into more-annotated-commitlhchavez
2020-02-23Merge pull request #400 from ramanenka/git_index_add_frombufferlhchavez
Add binding for `git_index_add_frombuffer`
2020-02-23Update the method namelhchavez
2020-02-23Merge remote-tracking branch 'upstream/master' into git_index_add_frombufferlhchavez
2020-02-22Remove Version from RevertOptionsRichard Burke
Version is defaulted to GIT_REVERT_OPTIONS_VERSION
2020-02-22Add revert functionalityRichard Burke
Closes #436
2020-02-22Free() the copies of repository.LookupXxx()lhchavez
`repository.LookupXxx()` allocate new go `Object`s that have a reference to a `C.git_object`. Those are then duplicated with `git_object_dup()`, so the original `Object`s linger unnecessarily until the Go GC kicks in. This change explicitly calls `Free()` on the originals to avoid unnecessary accumulation of garbage.
2020-02-22Update CI configurationlhchavez
This change: * Updates the GitHub actions so that they run different commands for the dynamic and static flavors of libgit2. * Updates the .travis.yml file so that it does roughly the same as the GitHub actions. * Adds the release-* branches to the CI configurations.
2020-02-20Uprev libgit2lhchavez
This uprevs libgit2 to the latest and greatest. Notably, * Fixes the interface of `git_mempack_reset`, since it now returns an `int` instead of being `void`. Fixes: #533
2020-02-12Merge pull request #520 from libgit2/actionslhchavez
Setup CI via Actions
2020-02-13Fix build for go 1.9lhchavez
This change makes the #includes between credentials.go and remote.go consistent to avoid a build error in go 1.9.
2020-02-13Merge remote-tracking branch 'origin/master' into actionslhchavez
2020-02-12Update .github/workflows/ci.ymllhchavez
2020-02-12Merge pull request #527 from dbolkensteyn/masterlhchavez
Fixes #513 - Segfault during tree walk
2020-02-12Merge pull request #523 from josharian/diff-stringerslhchavez
make Delta and DiffLineType stringers
2020-02-12Merge pull request #524 from josharian/doc-paramslhchavez
provide param names in DiffForEachFileCallback