Commit Graph

498 Commits

Author SHA1 Message Date
Carlos Martín Nieto f2d8797a96 Merge pull request #231 from shurcooL/master-fix-HandleList-Track-gc-issue
[master] Prevent slot int variable from being GCed.
2015-07-28 08:09:01 +02:00
Dmitri Shuralyov e1e1b4b1e1 Prevent slot int variable from being GCed.
Before this change, there were no users of slot int variable in the Go
world (just a pointer to it that ended up in C world only), so Go's
garbage collector would free it and its value could not retrieved later
(once a pointer to it comes back to Go world from C world).

Keep a pointer to it in the Go world so that does not happen.

Fixes #218.
2015-07-26 15:02:40 -07:00
Carlos Martín Nieto 4eae20ec27 Adjust style 2015-07-01 16:00:17 +02:00
Carlos Martín Nieto 84275e691f Merge commit 'refs/pull/198/head' of github.com:libgit2/git2go 2015-07-01 15:58:21 +02:00
Carlos Martín Nieto 2475907105 Merge commit 'refs/pull/174/head' of github.com:libgit2/git2go 2015-07-01 15:56:06 +02:00
Carlos Martín Nieto d478f4b111 Merge pull request #216 from libgit2/diff
Add blob diffing
2015-06-30 10:56:47 +02:00
Carlos Martín Nieto e066d24efb Add DiffBlobs
This lets you diff two arbitrary blobs with arbitrary names.
2015-06-29 21:29:47 +02:00
Carlos Martín Nieto 86e9917919 diff: remove unnecessary args to Hunk and Line ctors 2015-06-29 21:29:47 +02:00
Carlos Martín Nieto 2488de286c Merge pull request #212 from libgit2/remote-handle
Make the network code use handles
2015-06-23 13:33:34 +02:00
Carlos Martín Nieto c00a05586b Make the network code use handles
This wasn't ported together with the rest, but it does exhibit the same
issues, so let's port it over now.
2015-06-10 13:37:59 +02:00
Carlos Martín Nieto 53fd8ea011 Merge pull request #211 from shinningstar/master
Free reference resource allocated by libgit2 during go garbage collecting
2015-06-09 11:27:44 +02:00
shinningstar 830e171463 Free reference resource allocated by libgit2 during go garbage collecting 2015-06-08 22:36:31 +08:00
Carlos Martín Nieto aefe85039e Merge pull request #210 from michaeledgar/master
Add error code matching GIT_EAUTH for authentication failures
2015-06-08 05:13:32 +02:00
Mike Edgar af7739787c Add error code matching GIT_EAUTH for authentication failures 2015-06-07 19:20:43 -04:00
taylorchu 53c158fbd7 Fix test error messages 2015-05-30 22:27:08 +02:00
Carlos Martín Nieto 35ff0de855 Merge pull request #196 from pks-t/pointer-indirection
[WIP/RFC] Pointer indirection
2015-05-30 22:23:23 +02:00
Patrick Steinhardt e8531dd5c3 diff: only untrack notify payload when it is set 2015-05-22 10:01:50 +02:00
Patrick Steinhardt c43afaf9c4 tree: use correct C callback signature 2015-05-22 09:56:21 +02:00
Patrick Steinhardt 1bd338af5e handles: do not store handles by uintptr
If we store values by uintptrs the GC may try to inspect their
values when it kicks in. As the pointers are most likely invalid,
this will result in an invalid pointer dereference, causing the
program to panic. We can fix this by storing values by an int
index value instead, returning pointers to those indices as
handles instead.
2015-05-22 09:50:16 +02:00
Patrick Steinhardt d95932c84a handles: panic when we cannot retrieve handle data 2015-05-22 09:02:39 +02:00
Patrick Steinhardt a843b7247f packbuilder: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt 83f9e6a705 blob: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt fe902f56a8 diff: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt 7ee534d0c5 handles: print pointer handle on panic. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt e919653755 odb: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt 9bbec34885 index: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt 0a336e4abd handles: start slot indices with 1
Using 0 as the first slot indice leads to not being able to
differentiate between a handle to the first element or a
NULL-handle. As current code may check whether the pointer is
NULL, change the first indice to be 1 instead.
2015-05-22 09:02:24 +02:00
Patrick Steinhardt de45a4b8ed submodule: use HandleList for C function callbacks 2015-05-22 09:02:24 +02:00
Patrick Steinhardt be3a626f2e tree: use HandleList for C function callbacks. 2015-05-22 09:02:24 +02:00
Patrick Steinhardt bde012f3d4 handles: correctly initialize all members 2015-05-22 09:02:24 +02:00
Carlos Martín Nieto 7750e85fd1 Introduce an indirection layer for pointers
As the Go runtime can move stacks at any point and the C code runs
concurrently with the rest of the system, we cannot assume that the
payloads we give to the C code will stay valid for any particular
duration.

We must therefore give the C code handles which we can then look up in
our own list when the callbacks get called.
2015-05-22 09:02:24 +02:00
Carlos Martín Nieto 193deb7ae3 Merge pull request #202 from libgit2/index-basics
Add a few basic index operations
2015-05-19 15:21:49 +02:00
Carlos Martín Nieto 72c19f73c9 Index: Add Path() accessor 2015-05-19 15:05:00 +02:00
Carlos Martín Nieto d7a0495000 Index: Add OpenIndex
This lets you persist an index at an arbitrary location.
2015-05-19 14:56:01 +02:00
Carlos Martín Nieto a8ad0d2040 Index: Add ReadTree() 2015-05-19 14:49:05 +02:00
Fernando Oliveira c1df2dcdc1 Add method to check if repo is detached 2015-04-30 23:16:12 -03:00
Carlos Martín Nieto f7781c0e00 Merge pull request #179 from schani/master
Additions
2015-04-27 23:29:49 +02:00
Carlos Martín Nieto 9538c7f750 Merge pull request #197 from pks-t/test-cleanups
tests: always clean up temporary repository dirs
2015-04-24 16:47:42 +02:00
Patrick Steinhardt e300945a3d tests: always clean up temporary repository dirs
Some test repositories are not correctly removed after the tests
did run. Fix by introducing a function that is to be used for
cleaning up temporary test repositories.
2015-04-24 13:01:51 +02:00
Carlos Martín Nieto e021457f27 Merge pull request #180 from arcamael/master
Add possibiliy of checkout on specific path
2015-04-03 14:45:38 +02:00
Carlos Martín Nieto 1ba7e13a3a Merge pull request #191 from kron4eg/patch-1
Test on travis using Go1.4
2015-04-03 14:43:11 +02:00
Artiom Di 6454808f69 Test on travis using Go1.4 too 2015-04-03 14:53:15 +03:00
Mark Probst b3e7304abf Add a FIXME. 2015-03-23 12:02:17 -07:00
Mark Probst 524cc7967b Add DiffIndexToWorkdir 2015-03-23 12:02:17 -07:00
Mark Probst 8622831b11 Add DiffTreeToWorkdirWithIndex 2015-03-23 12:02:17 -07:00
Mark Probst 43102043fb Add Commit.Amend 2015-03-23 12:02:16 -07:00
Geoffrey Ragot c4b8861b34 Add possibiliy of checkout on specific path 2015-03-15 10:14:29 +01:00
Carlos Martín Nieto a2878cf7b2 Merge branch 'v22' 2015-03-15 01:22:58 +01:00
Carlos Martín Nieto 1b44c0a234 Add a bit more on next vs master 2015-03-15 01:21:21 +01:00
Carlos Martín Nieto 137c4fc3c8 Merge branch 'master' into v22 2015-03-15 01:09:11 +01:00