Commit Graph

16 Commits

Author SHA1 Message Date
Calin Seciu 34fb7e03ec Fix crash when using Pathspec in StatusOptions
Using `StatusOptions.Pathspec` results in a fatal error panic with
the message 'unexpected signal during runtime execution'.

This is because the `&cpathspec` C.git_strarray gets freed in
`*StatusOptions.toC()` before being passed to
`C.git_status_init_options()` in `*Repository.StatusList()`
(see b3e7705c48/status.go (L138))

The relevant panic trace is:

```
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0xb01dfacedebac1e pc=0x4062609]

runtime stack:
runtime.throw(0x469a080, 0x2a)
    /usr/local/Cellar/go/1.5.1/libexec/src/runtime/panic.go:527 +0x90
runtime.sigpanic()
    /usr/local/Cellar/go/1.5.1/libexec/src/runtime/sigpanic_unix.go:12
+0x5a

goroutine 71 [syscall, locked to thread]:
runtime.cgocall(0x400a720, 0xc8204e9998, 0x0)
    /usr/local/Cellar/go/1.5.1/libexec/src/runtime/cgocall.go:120 +0x11b
fp=0xc8204e9968 sp=0xc8204e9938
github.com/libgit2/git2go._Cfunc_git_status_list_new(0xc8204c39c8,
0x5e17780, 0xc820478c40, 0xc800000000)
    ??:0 +0x39 fp=0xc8204e9998 sp=0xc8204e9968
github.com/libgit2/git2go.(*Repository).StatusList(0xc820013290,
0xc8204e9b58, 0x0, 0x0, 0x0)
    /Users/calin/go/src/github.com/libgit2/git2go/status.go:168 +0x11d
fp=0xc8204e99e8 sp=0xc8204e9998
```
2015-09-18 10:48:26 +02:00
Mark Probst 45d88ca5f4 go fmt 2015-03-04 15:52:59 -08:00
Carlos Martín Nieto a9d993f3d1 Remove useless includes 2014-12-11 02:59:07 +01:00
Carlos Martín Nieto 668aa5dae1 Make the constants have types
While Go will assign the correct type to a const block when it
auto-creates the values, assigning makes the const be typeless and will
only gain it in each particular use.

Make each constant in the blocks have an assigned type.
2014-10-28 11:29:31 +01:00
Ben Navetta d4734a41d5 remove unused status version field 2014-09-04 10:17:31 -04:00
Ben Navetta 1520978dcd give status option flags their own type 2014-09-04 10:15:13 -04:00
Ben Navetta 80997c6fa5 fix status list to handle null head_to_index in entries 2014-08-25 23:18:00 -04:00
Ben Navetta 0059b26255 add thread locking to status api 2014-08-25 18:20:54 -04:00
Ben Navetta 33ae83f4d9 remove status_foreach binding 2014-08-25 18:15:36 -04:00
Ben Navetta c8529e79da don't return anything from StatusList.Free 2014-08-25 17:41:35 -04:00
Ben Navetta 1cb654e4f2 add git_status_foreach binding 2014-08-19 08:51:18 -04:00
Ben Navetta 8fd7c2c609 add StatusFile function 2014-08-18 23:12:45 -04:00
Ben Navetta a093e20a88 add status option support 2014-08-18 22:58:53 -04:00
Ben Navetta 0513670745 add StatusList.EntryCount() 2014-08-18 20:11:14 -04:00
Ben Navetta 37ccc4c00d add ByIndex, reorder to match other files 2014-08-18 20:04:32 -04:00
Ben Navetta 39d825a2a8 status data types 2014-08-18 19:42:34 -04:00