Commit Graph

193 Commits

Author SHA1 Message Date
Jesse Ezell 85420f2002 Merge branch 'master' of http://github.com/libgit2/git2go into merge 2014-03-26 11:18:21 -07:00
Carlos Martín Nieto 2811845a12 Merge pull request #71 from jezell/add-index-write-tree-to
Add index WriteTreeTo + test
2014-03-21 05:29:57 +01:00
Carlos Martín Nieto b869775665 Merge pull request #70 from jezell/add-remote-list
Add git_remote_list + test
2014-03-21 05:29:05 +01:00
Jesse Ezell 1f3f8adda8 Add index WriteTreeTo + test 2014-03-20 20:49:05 -07:00
Jesse Ezell 5d8db7f936 return nil instead of empty array on error 2014-03-20 20:32:23 -07:00
Jesse Ezell 99d7f66477 add remote list 2014-03-20 20:32:15 -07:00
Carlos Martín Nieto 574f0dd12d Remote: remove Get prefix from refspecs
Idiomatic Go is to omit the Get from the getter methods.
2014-03-20 03:29:54 +01:00
Carlos Martín Nieto 3ae9813fca Clean up after the tests 2014-03-19 08:15:19 +01:00
Carlos Martín Nieto ad128bdefb Remote: don't mix allocators
We cannot ask libgit2 to free the memory we have allocated ourselves, as
it cannot know how to do it. Let's free the strarray ourselves.
2014-03-19 08:15:18 +01:00
Carlos Martín Nieto 3274d477c9 Merge pull request #68 from libgit2/cmn/oid-revamp
Oid revamp
2014-03-19 07:20:45 +01:00
Carlos Martín Nieto b82a72a9ce Oid: fix IsZero()
We need to compare against the number zero, not its ASCII value.
2014-03-19 03:58:02 +01:00
Carlos Martín Nieto 0bb73e43a8 Oid: use Go's conversion functions
Go already has all the necessary pieces for encoding and decoding hex
strings. Using them let's us avoid going into C land.

Benchmarks show this takes about half the time as using libgit2's
functions.
2014-03-19 03:57:36 +01:00
Carlos Martín Nieto c243c31f7d Oid: remove Bytes()
This is not needed. We can do id[:] to get a slice.
2014-03-19 03:56:50 +01:00
Carlos Martín Nieto c9c7c1e779 Oid: make NewOid take a string
This is the most common way of having an id that's not in Oid form, so
let's make it the "default" and rename to NewOidFromBytes() the one that
takes []byte.
2014-03-19 03:56:50 +01:00
Carlos Martín Nieto b6703d4767 Oid: make the type directly [20]byte
There is no need for a struct with a single field. An Oid is 20 bytes
which hold the binary representation of the hash, so let's use that
directly. Go lets us have methods on this new type just the same.
2014-03-19 03:56:50 +01:00
Carlos Martín Nieto b5ce60925e Merge pull request #69 from jezell/clone_opts_init_fix
Clone opts init fix
2014-03-19 03:56:38 +01:00
Jesse Ezell f1f0fa7335 fix naming on test 2014-03-18 19:38:02 -07:00
Jesse Ezell 3d7f737481 add simple clone test 2014-03-18 18:24:31 -07:00
Jesse Ezell d1e7ee53d5 fix clone options init 2014-03-18 18:23:33 -07:00
Carlos Martín Nieto 5f35f13737 Merge pull request #61 from jezell/remotes-wip
Cleaned up remotes / clone / add push / fetch
2014-03-18 05:21:35 +01:00
Carlos Martín Nieto dbdbb4b0d1 Merge pull request #67 from jezell/chunk-create-fix
fix chunk create return values
2014-03-17 16:04:05 +01:00
Jesse Ezell 663c2a69c9 fix chunk create logic 2014-03-16 22:09:12 -07:00
Jesse Ezell 51aa76d6f7 remove strarray wrappers 2014-03-11 16:25:22 -07:00
Jesse Ezell 0a172478dc fix return for old go versions / travis 2014-03-11 13:45:27 -07:00
Jesse Ezell 2f53196866 clean up clone code 2014-03-11 13:22:00 -07:00
Jesse Ezell d560b9e9bd cleanup clone code 2014-03-11 13:19:12 -07:00
Jesse Ezell 634acbe498 merge with latest 2014-03-11 12:55:57 -07:00
Jesse Ezell 8ad5cbc537 Merge branch 'merge' of https://github.com/jezell/git2go into merge 2014-03-11 12:49:29 -07:00
Jesse Ezell 6a068d5265 remove useless wrappers 2014-03-11 12:47:56 -07:00
Jesse Ezell 86efca0630 Merge branch 'jezell/merge' into merge 2014-03-11 12:42:18 -07:00
Jesse Ezell 7cbbeff7ac merge with latest 2014-03-11 12:42:08 -07:00
Jesse Ezell f1e889928a merge with latest, replace merge wrappers with go code 2014-03-11 12:29:40 -07:00
Carlos Martín Nieto 1cf8117814 Merge pull request #65 from jezell/blob_and_tree_updates
Minor API enhancements
2014-03-11 03:44:12 +01:00
Carlos Martín Nieto ea909d8518 Merge branch 'cmn/checkout-opts' 2014-03-11 03:36:28 +01:00
Carlos Martín Nieto 263884a908 CheckoutIndex: allow for index to be nil
Allow for the index to be nil and pass that to the library to use the
repository's index.
2014-03-11 03:30:56 +01:00
Carlos Martín Nieto b09c6d8bbe Move checkout functions options more in line with the library
Afjust Checkout -> CheckoutHead and pass nil if the options structure is
nil so as not to overide the library's decisions.
2014-03-11 03:27:35 +01:00
Carlos Martín Nieto b5b0f3f50e Remove custom checkout opts init function 2014-03-11 03:14:36 +01:00
Carlos Martín Nieto 42fce02197 Adjust to checkout_opts -> checkout_options 2014-03-11 03:09:48 +01:00
Carlos Martín Nieto 731f978b54 Merge pull request #58 from jezell/add-branch-lookup
Add branch functions
2014-03-11 02:59:33 +01:00
Jesse Ezell 5e163fa2e8 add blob chunk creation, creation of tree builders for specific trees, minor API cleanup 2014-03-07 16:43:20 -08:00
Jesse Ezell e5946d4009 Add defaults, add simple test, merge heads should be pointer array 2014-02-28 14:33:38 -08:00
Jesse Ezell 6af4d4a825 move finalizer above free 2014-02-28 11:15:39 -08:00
Jesse Ezell da64faf8bd switch from iota to explicit def 2014-02-28 11:13:51 -08:00
Jesse Ezell 127643eb54 move return outside of switch for go 1.0 / travis 2014-02-28 11:08:15 -08:00
Jesse Ezell 9fb7a746e0 fix handling of msg to treat empty str as nil 2014-02-28 10:58:53 -08:00
Jesse Ezell d6332f9526 fix msg handling to treat empty str as nil 2014-02-28 10:54:16 -08:00
Jesse Ezell b404c8b862 Remove unused consts 2014-02-28 10:47:56 -08:00
Jesse Ezell 2c56324ca5 fix bad git_buf handling 2014-02-28 10:46:57 -08:00
Carlos Martín Nieto f5f8e13744 Add a travis script
Add a build script and ask Travis to run it. It downloads the tip of
libgit2's dev branch and tests against that.
2014-02-28 15:15:32 +01:00
Carlos Martín Nieto 639b66345c Fix an old error function call that snuck in 2014-02-28 14:11:21 +01:00