Browse Source

Update vendoring

master
Dashie der otter 4 months ago
parent
commit
48953674c3
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
48 changed files with 108 additions and 58 deletions
  1. 5
    5
      Gopkg.lock
  2. 2
    2
      Gopkg.toml
  3. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/.gitmodules
  4. 2
    0
      vendor/gopkg.in/libgit2/git2go.v27/.travis.yml
  5. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/LICENSE
  6. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/Makefile
  7. 6
    6
      vendor/gopkg.in/libgit2/git2go.v27/README.md
  8. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/blame.go
  9. 5
    1
      vendor/gopkg.in/libgit2/git2go.v27/blob.go
  10. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/branch.go
  11. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/checkout.go
  12. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/cherrypick.go
  13. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/clone.go
  14. 32
    15
      vendor/gopkg.in/libgit2/git2go.v27/commit.go
  15. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/config.go
  16. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/credentials.go
  17. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/describe.go
  18. 2
    0
      vendor/gopkg.in/libgit2/git2go.v27/diff.go
  19. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/features.go
  20. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/git.go
  21. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go
  22. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/git_static.go
  23. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/graph.go
  24. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/handles.go
  25. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/ignore.go
  26. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/index.go
  27. 3
    0
      vendor/gopkg.in/libgit2/git2go.v27/merge.go
  28. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/note.go
  29. 5
    0
      vendor/gopkg.in/libgit2/git2go.v27/object.go
  30. 8
    2
      vendor/gopkg.in/libgit2/git2go.v27/odb.go
  31. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/packbuilder.go
  32. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/patch.go
  33. 1
    1
      vendor/gopkg.in/libgit2/git2go.v27/rebase.go
  34. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/refdb.go
  35. 3
    2
      vendor/gopkg.in/libgit2/git2go.v27/reference.go
  36. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/remote.go
  37. 2
    2
      vendor/gopkg.in/libgit2/git2go.v27/repository.go
  38. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/reset.go
  39. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/revparse.go
  40. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/settings.go
  41. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/signature.go
  42. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/stash.go
  43. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/status.go
  44. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/submodule.go
  45. 13
    10
      vendor/gopkg.in/libgit2/git2go.v27/tag.go
  46. 13
    6
      vendor/gopkg.in/libgit2/git2go.v27/tree.go
  47. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/walk.go
  48. 0
    0
      vendor/gopkg.in/libgit2/git2go.v27/wrapper.c

+ 5
- 5
Gopkg.lock View File

@@ -395,12 +395,12 @@
395 395
   version = "v1.41.0"
396 396
 
397 397
 [[projects]]
398
-  branch = "v26"
399
-  digest = "1:79a5003bce9bc94ea61fe4b7a88382b5f367585400122ed3feb5e483031834b6"
400
-  name = "gopkg.in/libgit2/git2go.v26"
398
+  branch = "v27"
399
+  digest = "1:6af8f24e29863581ecaa0900389a20c5b7cd13506fb83c317494a4f92253d6d5"
400
+  name = "gopkg.in/libgit2/git2go.v27"
401 401
   packages = ["."]
402 402
   pruneopts = "UT"
403
-  revision = "c9f7fd544d3991bd26c400b3c227673bcada42cc"
403
+  revision = "ecaeb7a21d479b7966311760a2e8bd734f8f0eef"
404 404
 
405 405
 [[projects]]
406 406
   digest = "1:3d43a1d68f315a1c4c2cd20ee4d35c96695f17637502366341ac43b7813ea95f"
@@ -441,7 +441,7 @@
441 441
     "gopkg.in/clog.v1",
442 442
     "gopkg.in/gomail.v2",
443 443
     "gopkg.in/ini.v1",
444
-    "gopkg.in/libgit2/git2go.v26",
444
+    "gopkg.in/libgit2/git2go.v27",
445 445
     "gopkg.in/macaron.v1",
446 446
   ]
447 447
   solver-name = "gps-cdcl"

+ 2
- 2
Gopkg.toml View File

@@ -134,8 +134,8 @@
134 134
   version = "1.41.0"
135 135
 
136 136
 [[constraint]]
137
-  branch = "v26"
138
-  name = "gopkg.in/libgit2/git2go.v26"
137
+  branch = "v27"
138
+  name = "gopkg.in/libgit2/git2go.v27"
139 139
 
140 140
 [[constraint]]
141 141
   name = "gopkg.in/macaron.v1"

vendor/gopkg.in/libgit2/git2go.v26/.gitmodules → vendor/gopkg.in/libgit2/git2go.v27/.gitmodules View File


vendor/gopkg.in/libgit2/git2go.v26/.travis.yml → vendor/gopkg.in/libgit2/git2go.v27/.travis.yml View File

@@ -3,6 +3,8 @@ language: go
3 3
 go:
4 4
   - 1.7
5 5
   - 1.8
6
+  - 1.9
7
+  - "1.10"
6 8
   - tip
7 9
 
8 10
 script: make test-static

vendor/gopkg.in/libgit2/git2go.v26/LICENSE → vendor/gopkg.in/libgit2/git2go.v27/LICENSE View File


vendor/gopkg.in/libgit2/git2go.v26/Makefile → vendor/gopkg.in/libgit2/git2go.v27/Makefile View File


vendor/gopkg.in/libgit2/git2go.v26/README.md → vendor/gopkg.in/libgit2/git2go.v27/README.md View File

@@ -35,9 +35,9 @@ If using `master` or building a branch statically, we need to build libgit2 firs
35 35
 Run `go get -d github.com/libgit2/git2go` to download the code and go to your `$GOPATH/src/github.com/libgit2/git2go` directory. From there, we need to build the C code and put it into the resulting go binary.
36 36
 
37 37
     git submodule update --init # get libgit2
38
-    make install
38
+    make install-static
39 39
 
40
-will compile libgit2, link it into git2go and install it.
40
+will compile libgit2, link it into git2go and install it. The `master` branch is set up to follow the specific libgit2 version that is vendored, so trying dynamic linking may or may not work depending on the exact versions involved.
41 41
 
42 42
 Parallelism and network operations
43 43
 ----------------------------------
@@ -47,19 +47,19 @@ libgit2 may use OpenSSL and LibSSH2 for performing encrypted network connections
47 47
 Running the tests
48 48
 -----------------
49 49
 
50
-For the stable version, `go test` will work as usual. For the `next` branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built
50
+For the stable version, `go test` will work as usual. For the `master` branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built
51 51
 
52
-    make test
52
+    make test-static
53 53
 
54 54
 Alternatively, you can build the library manually first and then run the tests
55 55
 
56 56
     ./script/build-libgit2-static.sh
57
-    go test -v
57
+    go test -v --tags "static" ./...
58 58
 
59 59
 License
60 60
 -------
61 61
 
62
-M to the I to the T. See the LICENSE file if you've never seen a MIT license before.
62
+M to the I to the T. See the LICENSE file if you've never seen an MIT license before.
63 63
 
64 64
 Authors
65 65
 -------

vendor/gopkg.in/libgit2/git2go.v26/blame.go → vendor/gopkg.in/libgit2/git2go.v27/blame.go View File


vendor/gopkg.in/libgit2/git2go.v26/blob.go → vendor/gopkg.in/libgit2/git2go.v27/blob.go View File

@@ -20,6 +20,10 @@ type Blob struct {
20 20
 	cast_ptr *C.git_blob
21 21
 }
22 22
 
23
+func (b *Blob) AsObject() *Object {
24
+	return &b.Object
25
+}
26
+
23 27
 func (v *Blob) Size() int64 {
24 28
 	ret := int64(C.git_blob_rawsize(v.cast_ptr))
25 29
 	runtime.KeepAlive(v)
@@ -44,7 +48,7 @@ func (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error) {
44 48
 	var size C.size_t
45 49
 
46 50
 	// Go 1.6 added some increased checking of passing pointer to
47
-	// C, but its check depends on its expectations of waht we
51
+	// C, but its check depends on its expectations of what we
48 52
 	// pass to the C function, so unless we take the address of
49 53
 	// its contents at the call site itself, it can fail when
50 54
 	// 'data' is a slice of a slice.

vendor/gopkg.in/libgit2/git2go.v26/branch.go → vendor/gopkg.in/libgit2/git2go.v27/branch.go View File


vendor/gopkg.in/libgit2/git2go.v26/checkout.go → vendor/gopkg.in/libgit2/git2go.v27/checkout.go View File


vendor/gopkg.in/libgit2/git2go.v26/cherrypick.go → vendor/gopkg.in/libgit2/git2go.v27/cherrypick.go View File


vendor/gopkg.in/libgit2/git2go.v26/clone.go → vendor/gopkg.in/libgit2/git2go.v27/clone.go View File


vendor/gopkg.in/libgit2/git2go.v26/commit.go → vendor/gopkg.in/libgit2/git2go.v27/commit.go View File

@@ -18,15 +18,23 @@ type Commit struct {
18 18
 	cast_ptr *C.git_commit
19 19
 }
20 20
 
21
-func (c Commit) Message() string {
22
-	return C.GoString(C.git_commit_message(c.cast_ptr))
21
+func (c *Commit) AsObject() *Object {
22
+	return &c.Object
23 23
 }
24 24
 
25
-func (c Commit) RawMessage() string {
26
-	return C.GoString(C.git_commit_message_raw(c.cast_ptr))
25
+func (c *Commit) Message() string {
26
+	ret := C.GoString(C.git_commit_message(c.cast_ptr))
27
+	runtime.KeepAlive(c)
28
+	return ret
27 29
 }
28 30
 
29
-func (c Commit) ExtractSignature() (string, string, error) {
31
+func (c *Commit) RawMessage() string {
32
+	ret := C.GoString(C.git_commit_message_raw(c.cast_ptr))
33
+	runtime.KeepAlive(c)
34
+	return ret
35
+}
36
+
37
+func (c *Commit) ExtractSignature() (string, string, error) {
30 38
 
31 39
 	var c_signed C.git_buf
32 40
 	defer C.git_buf_free(&c_signed)
@@ -40,7 +48,7 @@ func (c Commit) ExtractSignature() (string, string, error) {
40 48
 	runtime.LockOSThread()
41 49
 	defer runtime.UnlockOSThread()
42 50
 	ret := C.git_commit_extract_signature(&c_signature, &c_signed, repo, oid.toC(), nil)
43
-
51
+	runtime.KeepAlive(oid)
44 52
 	if ret < 0 {
45 53
 		return "", "", MakeGitError(ret)
46 54
 	} else {
@@ -49,17 +57,20 @@ func (c Commit) ExtractSignature() (string, string, error) {
49 57
 
50 58
 }
51 59
 
52
-func (c Commit) Summary() string {
53
-	return C.GoString(C.git_commit_summary(c.cast_ptr))
60
+func (c *Commit) Summary() string {
61
+	ret := C.GoString(C.git_commit_summary(c.cast_ptr))
62
+	runtime.KeepAlive(c)
63
+	return ret
54 64
 }
55 65
 
56
-func (c Commit) Tree() (*Tree, error) {
66
+func (c *Commit) Tree() (*Tree, error) {
57 67
 	var ptr *C.git_tree
58 68
 
59 69
 	runtime.LockOSThread()
60 70
 	defer runtime.UnlockOSThread()
61 71
 
62 72
 	err := C.git_commit_tree(&ptr, c.cast_ptr)
73
+	runtime.KeepAlive(c)
63 74
 	if err < 0 {
64 75
 		return nil, MakeGitError(err)
65 76
 	}
@@ -67,18 +78,24 @@ func (c Commit) Tree() (*Tree, error) {
67 78
 	return allocTree(ptr, c.repo), nil
68 79
 }
69 80
 
70
-func (c Commit) TreeId() *Oid {
71
-	return newOidFromC(C.git_commit_tree_id(c.cast_ptr))
81
+func (c *Commit) TreeId() *Oid {
82
+	ret := newOidFromC(C.git_commit_tree_id(c.cast_ptr))
83
+	runtime.KeepAlive(c)
84
+	return ret
72 85
 }
73 86
 
74
-func (c Commit) Author() *Signature {
87
+func (c *Commit) Author() *Signature {
75 88
 	cast_ptr := C.git_commit_author(c.cast_ptr)
76
-	return newSignatureFromC(cast_ptr)
89
+	ret := newSignatureFromC(cast_ptr)
90
+	runtime.KeepAlive(c)
91
+	return ret
77 92
 }
78 93
 
79
-func (c Commit) Committer() *Signature {
94
+func (c *Commit) Committer() *Signature {
80 95
 	cast_ptr := C.git_commit_committer(c.cast_ptr)
81
-	return newSignatureFromC(cast_ptr)
96
+	ret := newSignatureFromC(cast_ptr)
97
+	runtime.KeepAlive(c)
98
+	return ret
82 99
 }
83 100
 
84 101
 func (c *Commit) Parent(n uint) *Commit {

vendor/gopkg.in/libgit2/git2go.v26/config.go → vendor/gopkg.in/libgit2/git2go.v27/config.go View File

@@ -77,7 +77,7 @@ func (c *Config) AddFile(path string, level ConfigLevel, force bool) error {
77 77
 	runtime.LockOSThread()
78 78
 	defer runtime.UnlockOSThread()
79 79
 
80
-	ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), cbool(force))
80
+	ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force))
81 81
 	runtime.KeepAlive(c)
82 82
 	if ret < 0 {
83 83
 		return MakeGitError(ret)

vendor/gopkg.in/libgit2/git2go.v26/credentials.go → vendor/gopkg.in/libgit2/git2go.v27/credentials.go View File


vendor/gopkg.in/libgit2/git2go.v26/describe.go → vendor/gopkg.in/libgit2/git2go.v27/describe.go View File


vendor/gopkg.in/libgit2/git2go.v26/diff.go → vendor/gopkg.in/libgit2/git2go.v27/diff.go View File

@@ -437,6 +437,8 @@ const (
437 437
 	DiffShowUnmodified       DiffOptionsFlag = C.GIT_DIFF_SHOW_UNMODIFIED
438 438
 	DiffPatience             DiffOptionsFlag = C.GIT_DIFF_PATIENCE
439 439
 	DiffMinimal              DiffOptionsFlag = C.GIT_DIFF_MINIMAL
440
+	DiffShowBinary           DiffOptionsFlag = C.GIT_DIFF_SHOW_BINARY
441
+	DiffIndentHeuristic      DiffOptionsFlag = C.GIT_DIFF_INDENT_HEURISTIC
440 442
 )
441 443
 
442 444
 type DiffNotifyCallback func(diffSoFar *Diff, deltaToAdd DiffDelta, matchedPathspec string) error

vendor/gopkg.in/libgit2/git2go.v26/features.go → vendor/gopkg.in/libgit2/git2go.v27/features.go View File


vendor/gopkg.in/libgit2/git2go.v26/git.go → vendor/gopkg.in/libgit2/git2go.v27/git.go View File


vendor/gopkg.in/libgit2/git2go.v26/git_dynamic.go → vendor/gopkg.in/libgit2/git2go.v27/git_dynamic.go View File

@@ -6,8 +6,8 @@ package git
6 6
 #include <git2.h>
7 7
 #cgo pkg-config: libgit2
8 8
 
9
-#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
10
-# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
9
+#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 27
10
+# error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
11 11
 #endif
12 12
 
13 13
 */

vendor/gopkg.in/libgit2/git2go.v26/git_static.go → vendor/gopkg.in/libgit2/git2go.v27/git_static.go View File

@@ -9,8 +9,8 @@ package git
9 9
 #cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
10 10
 #include <git2.h>
11 11
 
12
-#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 26
13
-# error "Invalid libgit2 version; this git2go supports libgit2 v0.26"
12
+#if LIBGIT2_VER_MAJOR != 0 || LIBGIT2_VER_MINOR != 27
13
+# error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
14 14
 #endif
15 15
 
16 16
 */

vendor/gopkg.in/libgit2/git2go.v26/graph.go → vendor/gopkg.in/libgit2/git2go.v27/graph.go View File


vendor/gopkg.in/libgit2/git2go.v26/handles.go → vendor/gopkg.in/libgit2/git2go.v27/handles.go View File


vendor/gopkg.in/libgit2/git2go.v26/ignore.go → vendor/gopkg.in/libgit2/git2go.v27/ignore.go View File


vendor/gopkg.in/libgit2/git2go.v26/index.go → vendor/gopkg.in/libgit2/git2go.v27/index.go View File


vendor/gopkg.in/libgit2/git2go.v26/merge.go → vendor/gopkg.in/libgit2/git2go.v27/merge.go View File

@@ -355,6 +355,7 @@ type MergeFileOptions struct {
355 355
 	TheirLabel    string
356 356
 	Favor         MergeFileFavor
357 357
 	Flags         MergeFileFlags
358
+	MarkerSize    uint16
358 359
 }
359 360
 
360 361
 func mergeFileOptionsFromC(c C.git_merge_file_options) MergeFileOptions {
@@ -364,6 +365,7 @@ func mergeFileOptionsFromC(c C.git_merge_file_options) MergeFileOptions {
364 365
 		TheirLabel:    C.GoString(c.their_label),
365 366
 		Favor:         MergeFileFavor(c.favor),
366 367
 		Flags:         MergeFileFlags(c.flags),
368
+		MarkerSize:    uint16(c.marker_size),
367 369
 	}
368 370
 }
369 371
 
@@ -373,6 +375,7 @@ func populateCMergeFileOptions(c *C.git_merge_file_options, options MergeFileOpt
373 375
 	c.their_label = C.CString(options.TheirLabel)
374 376
 	c.favor = C.git_merge_file_favor_t(options.Favor)
375 377
 	c.flags = C.git_merge_file_flag_t(options.Flags)
378
+	c.marker_size = C.ushort(options.MarkerSize)
376 379
 }
377 380
 
378 381
 func freeCMergeFileOptions(c *C.git_merge_file_options) {

vendor/gopkg.in/libgit2/git2go.v26/note.go → vendor/gopkg.in/libgit2/git2go.v27/note.go View File


vendor/gopkg.in/libgit2/git2go.v26/object.go → vendor/gopkg.in/libgit2/git2go.v27/object.go View File

@@ -26,6 +26,11 @@ type Object struct {
26 26
 	repo *Repository
27 27
 }
28 28
 
29
+// Objecter lets us accept any kind of Git object in functions.
30
+type Objecter interface {
31
+	AsObject() *Object
32
+}
33
+
29 34
 func (t ObjectType) String() string {
30 35
 	switch t {
31 36
 	case ObjectAny:

vendor/gopkg.in/libgit2/git2go.v26/odb.go → vendor/gopkg.in/libgit2/git2go.v27/odb.go View File

@@ -182,17 +182,21 @@ func (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error) {
182 182
 // contents of the object.
183 183
 func (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error) {
184 184
 	stream := new(OdbReadStream)
185
+	var ctype C.git_otype
186
+	var csize C.size_t
185 187
 
186 188
 	runtime.LockOSThread()
187 189
 	defer runtime.UnlockOSThread()
188 190
 
189
-	ret := C.git_odb_open_rstream(&stream.ptr, v.ptr, id.toC())
191
+	ret := C.git_odb_open_rstream(&stream.ptr, &csize, &ctype, v.ptr, id.toC())
190 192
 	runtime.KeepAlive(v)
191 193
 	runtime.KeepAlive(id)
192 194
 	if ret < 0 {
193 195
 		return nil, MakeGitError(ret)
194 196
 	}
195 197
 
198
+	stream.Size = uint64(csize)
199
+	stream.Type = ObjectType(ctype)
196 200
 	runtime.SetFinalizer(stream, (*OdbReadStream).Free)
197 201
 	return stream, nil
198 202
 }
@@ -264,7 +268,9 @@ func (object *OdbObject) Data() (data []byte) {
264 268
 }
265 269
 
266 270
 type OdbReadStream struct {
267
-	ptr *C.git_odb_stream
271
+	ptr  *C.git_odb_stream
272
+	Size uint64
273
+	Type ObjectType
268 274
 }
269 275
 
270 276
 // Read reads from the stream

vendor/gopkg.in/libgit2/git2go.v26/packbuilder.go → vendor/gopkg.in/libgit2/git2go.v27/packbuilder.go View File


vendor/gopkg.in/libgit2/git2go.v26/patch.go → vendor/gopkg.in/libgit2/git2go.v27/patch.go View File

@@ -69,7 +69,7 @@ func (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []
69 69
 	var patchPtr *C.git_patch
70 70
 
71 71
 	oldPtr := toPointer(oldBuf)
72
-	newPtr := (*C.char)(toPointer(newBuf))
72
+	newPtr := toPointer(newBuf)
73 73
 
74 74
 	cOldPath := C.CString(oldPath)
75 75
 	defer C.free(unsafe.Pointer(cOldPath))

vendor/gopkg.in/libgit2/git2go.v26/rebase.go → vendor/gopkg.in/libgit2/git2go.v27/rebase.go View File

@@ -30,7 +30,7 @@ const (
30 30
 var RebaseNoOperation uint = ^uint(0)
31 31
 
32 32
 // Error returned if there is no current rebase operation
33
-var ErrRebaseNoOperation = errors.New("o current rebase operation")
33
+var ErrRebaseNoOperation = errors.New("no current rebase operation")
34 34
 
35 35
 // RebaseOperation describes a single instruction/operation to be performed during the rebase.
36 36
 type RebaseOperation struct {

vendor/gopkg.in/libgit2/git2go.v26/refdb.go → vendor/gopkg.in/libgit2/git2go.v27/refdb.go View File


vendor/gopkg.in/libgit2/git2go.v26/reference.go → vendor/gopkg.in/libgit2/git2go.v27/reference.go View File

@@ -301,7 +301,7 @@ func (v *Reference) Owner() *Repository {
301 301
 	}
302 302
 }
303 303
 
304
-// Cmp compares both references, retursn 0 on equality, otherwise a
304
+// Cmp compares v to ref2. It returns 0 on equality, otherwise a
305 305
 // stable sorting.
306 306
 func (v *Reference) Cmp(ref2 *Reference) int {
307 307
 	ret := int(C.git_reference_cmp(v.ptr, ref2.ptr))
@@ -310,13 +310,14 @@ func (v *Reference) Cmp(ref2 *Reference) int {
310 310
 	return ret
311 311
 }
312 312
 
313
-// Shorthand ret :=s a "human-readable" short reference name
313
+// Shorthand returns a "human-readable" short reference name.
314 314
 func (v *Reference) Shorthand() string {
315 315
 	ret := C.GoString(C.git_reference_shorthand(v.ptr))
316 316
 	runtime.KeepAlive(v)
317 317
 	return ret
318 318
 }
319 319
 
320
+// Name returns the full name of v.
320 321
 func (v *Reference) Name() string {
321 322
 	ret := C.GoString(C.git_reference_name(v.ptr))
322 323
 	runtime.KeepAlive(v)

vendor/gopkg.in/libgit2/git2go.v26/remote.go → vendor/gopkg.in/libgit2/git2go.v27/remote.go View File


vendor/gopkg.in/libgit2/git2go.v26/repository.go → vendor/gopkg.in/libgit2/git2go.v27/repository.go View File

@@ -19,10 +19,10 @@ type Repository struct {
19 19
 	Remotes RemoteCollection
20 20
 	// Submodules represents the collection of submodules and can
21 21
 	// be used to add, remove and configure submodules in this
22
-	// repostiory.
22
+	// repository.
23 23
 	Submodules SubmoduleCollection
24 24
 	// References represents the collection of references and can
25
-	// be used to create, remove or update refernces for this repository.
25
+	// be used to create, remove or update references for this repository.
26 26
 	References ReferenceCollection
27 27
 	// Notes represents the collection of notes and can be used to
28 28
 	// read, write and delete notes from this repository.

vendor/gopkg.in/libgit2/git2go.v26/reset.go → vendor/gopkg.in/libgit2/git2go.v27/reset.go View File


vendor/gopkg.in/libgit2/git2go.v26/revparse.go → vendor/gopkg.in/libgit2/git2go.v27/revparse.go View File


vendor/gopkg.in/libgit2/git2go.v26/settings.go → vendor/gopkg.in/libgit2/git2go.v27/settings.go View File


vendor/gopkg.in/libgit2/git2go.v26/signature.go → vendor/gopkg.in/libgit2/git2go.v27/signature.go View File


vendor/gopkg.in/libgit2/git2go.v26/stash.go → vendor/gopkg.in/libgit2/git2go.v27/stash.go View File


vendor/gopkg.in/libgit2/git2go.v26/status.go → vendor/gopkg.in/libgit2/git2go.v27/status.go View File


vendor/gopkg.in/libgit2/git2go.v26/submodule.go → vendor/gopkg.in/libgit2/git2go.v27/submodule.go View File


vendor/gopkg.in/libgit2/git2go.v26/tag.go → vendor/gopkg.in/libgit2/git2go.v27/tag.go View File

@@ -17,6 +17,10 @@ type Tag struct {
17 17
 	cast_ptr *C.git_tag
18 18
 }
19 19
 
20
+func (t *Tag) AsObject() *Object {
21
+	return &t.Object
22
+}
23
+
20 24
 func (t Tag) Message() string {
21 25
 	ret := C.GoString(C.git_tag_message(t.cast_ptr))
22 26
 	runtime.KeepAlive(t)
@@ -63,8 +67,7 @@ type TagsCollection struct {
63 67
 	repo *Repository
64 68
 }
65 69
 
66
-func (c *TagsCollection) Create(
67
-	name string, commit *Commit, tagger *Signature, message string) (*Oid, error) {
70
+func (c *TagsCollection) Create(name string, obj Objecter, tagger *Signature, message string) (*Oid, error) {
68 71
 
69 72
 	oid := new(Oid)
70 73
 
@@ -80,13 +83,13 @@ func (c *TagsCollection) Create(
80 83
 	}
81 84
 	defer C.git_signature_free(taggerSig)
82 85
 
83
-	ctarget := commit.ptr
84
-
85 86
 	runtime.LockOSThread()
86 87
 	defer runtime.UnlockOSThread()
87 88
 
88
-	ret := C.git_tag_create(oid.toC(), c.repo.ptr, cname, ctarget, taggerSig, cmessage, 0)
89
+	o := obj.AsObject()
90
+	ret := C.git_tag_create(oid.toC(), c.repo.ptr, cname, o.ptr, taggerSig, cmessage, 0)
89 91
 	runtime.KeepAlive(c)
92
+	runtime.KeepAlive(obj)
90 93
 	if ret < 0 {
91 94
 		return nil, MakeGitError(ret)
92 95
 	}
@@ -110,7 +113,7 @@ func (c *TagsCollection) Remove(name string) error {
110 113
 	return nil
111 114
 }
112 115
 
113
-// CreateLightweight creates a new lightweight tag pointing to a commit
116
+// CreateLightweight creates a new lightweight tag pointing to an object
114 117
 // and returns the id of the target object.
115 118
 //
116 119
 // The name of the tag is validated for consistency (see git_tag_create() for the rules
@@ -122,20 +125,20 @@ func (c *TagsCollection) Remove(name string) error {
122 125
 // The created tag is a simple reference and can be queried using
123 126
 // repo.References.Lookup("refs/tags/<name>"). The name of the tag (eg "v1.0.0")
124 127
 // is queried with ref.Shorthand().
125
-func (c *TagsCollection) CreateLightweight(name string, commit *Commit, force bool) (*Oid, error) {
128
+func (c *TagsCollection) CreateLightweight(name string, obj Objecter, force bool) (*Oid, error) {
126 129
 
127 130
 	oid := new(Oid)
128 131
 
129 132
 	cname := C.CString(name)
130 133
 	defer C.free(unsafe.Pointer(cname))
131 134
 
132
-	ctarget := commit.ptr
133
-
134 135
 	runtime.LockOSThread()
135 136
 	defer runtime.UnlockOSThread()
136 137
 
137
-	err := C.git_tag_create_lightweight(oid.toC(), c.repo.ptr, cname, ctarget, cbool(force))
138
+	o := obj.AsObject()
139
+	err := C.git_tag_create_lightweight(oid.toC(), c.repo.ptr, cname, o.ptr, cbool(force))
138 140
 	runtime.KeepAlive(c)
141
+	runtime.KeepAlive(obj)
139 142
 	if err < 0 {
140 143
 		return nil, MakeGitError(err)
141 144
 	}

vendor/gopkg.in/libgit2/git2go.v26/tree.go → vendor/gopkg.in/libgit2/git2go.v27/tree.go View File

@@ -27,6 +27,10 @@ type Tree struct {
27 27
 	cast_ptr *C.git_tree
28 28
 }
29 29
 
30
+func (t *Tree) AsObject() *Object {
31
+	return &t.Object
32
+}
33
+
30 34
 type TreeEntry struct {
31 35
 	Name     string
32 36
 	Id       *Oid
@@ -48,12 +52,13 @@ func (t Tree) EntryByName(filename string) *TreeEntry {
48 52
 	defer C.free(unsafe.Pointer(cname))
49 53
 
50 54
 	entry := C.git_tree_entry_byname(t.cast_ptr, cname)
51
-	runtime.KeepAlive(t)
52 55
 	if entry == nil {
53 56
 		return nil
54 57
 	}
55 58
 
56
-	return newTreeEntry(entry)
59
+	goEntry := newTreeEntry(entry)
60
+	runtime.KeepAlive(t)
61
+	return goEntry
57 62
 }
58 63
 
59 64
 // EntryById performs a lookup for a tree entry with the given SHA value.
@@ -67,13 +72,14 @@ func (t Tree) EntryById(id *Oid) *TreeEntry {
67 72
 	defer runtime.UnlockOSThread()
68 73
 
69 74
 	entry := C.git_tree_entry_byid(t.cast_ptr, id.toC())
70
-	runtime.KeepAlive(t)
71 75
 	runtime.KeepAlive(id)
72 76
 	if entry == nil {
73 77
 		return nil
74 78
 	}
75 79
 
76
-	return newTreeEntry(entry)
80
+	goEntry := newTreeEntry(entry)
81
+	runtime.KeepAlive(t)
82
+	return goEntry
77 83
 }
78 84
 
79 85
 // EntryByPath looks up an entry by its full path, recursing into
@@ -98,12 +104,13 @@ func (t Tree) EntryByPath(path string) (*TreeEntry, error) {
98 104
 
99 105
 func (t Tree) EntryByIndex(index uint64) *TreeEntry {
100 106
 	entry := C.git_tree_entry_byindex(t.cast_ptr, C.size_t(index))
101
-	runtime.KeepAlive(t)
102 107
 	if entry == nil {
103 108
 		return nil
104 109
 	}
105 110
 
106
-	return newTreeEntry(entry)
111
+	goEntry := newTreeEntry(entry)
112
+	runtime.KeepAlive(t)
113
+	return goEntry
107 114
 }
108 115
 
109 116
 func (t Tree) EntryCount() uint64 {

vendor/gopkg.in/libgit2/git2go.v26/walk.go → vendor/gopkg.in/libgit2/git2go.v27/walk.go View File


vendor/gopkg.in/libgit2/git2go.v26/wrapper.c → vendor/gopkg.in/libgit2/git2go.v27/wrapper.c View File


Loading…
Cancel
Save