Commit Graph

400 Commits

Author SHA1 Message Date
Jesse Ezell fe509411a5 Add thread locking 2014-02-26 08:45:38 -08:00
Jesse Ezell a728f70358 cleanup add-branch 2014-02-26 07:33:50 -08:00
Jesse Ezell 6a8e126cb9 Merge branch 'branch_functions' of http://github.com/JohannWeging/git2go into merge-add-branch-lookup 2014-02-26 07:32:16 -08:00
Carlos Martín Nieto 1c1f7bd1fa Merge branch 'more-errors' 2014-02-26 16:15:10 +01:00
Carlos Martín Nieto 00ea11691b Convert the rest of the errors 2014-02-26 16:14:31 +01:00
Jesper Hansen 499f52a354 Added git error code to the error object. 2014-02-26 16:10:00 +01:00
Carlos Martín Nieto 3e5586bd8d Remove 'oid' as id name
Following the cleanup from libgit2, let's not use 'oid' unless we mean
the name of the data type. In the other cases, we mean an identifier,
hence the name 'id'.
2014-02-26 15:30:16 +01:00
Carlos Martín Nieto 5f4283fac3 Merge branch 'index-entries' 2014-02-26 15:22:53 +01:00
Carlos Martín Nieto 14f902afed Adjust to oid -> id 2014-02-26 15:22:48 +01:00
Carlos Martín Nieto 1e01cae286 Remove pointer to git_index_entry
We have all the data
2014-02-26 15:19:07 +01:00
Carlos Martín Nieto 2c8de242ee Allow for a default in reflog messages
We don't have a way to represent a NULL string, so if the user passes an
empty string, let's pass NULL down so we tell libgit2 to use the default.
2014-02-26 15:01:23 +01:00
Carlos Martín Nieto ca2c3c6db2 Add a few reference utility functions 2014-02-26 14:51:04 +01:00
lye 45b0f17c04 Bundle consts more idiomatically; add GitLineType alias. 2014-02-26 05:58:45 -06:00
lye 2e5102b71a Unwrap DiffLine; add types for git_diff_flag_t and git_delta_t. 2014-02-26 04:36:04 -06:00
Carlos Martín Nieto 786393a380 Merge pull request #42 from libgit2/cmn/config
Wrap some more config functions
2014-02-26 10:37:35 +01:00
Carlos Martín Nieto fc0a2f56e8 Lock the thread so we can get the error message 2014-02-26 10:37:02 +01:00
Carlos Martín Nieto af2446b1da Add iterators and ConfigEntry 2014-02-26 10:37:01 +01:00
Carlos Martín Nieto 129105d410 Add a few more missing config functions 2014-02-26 10:36:35 +01:00
Carlos Martín Nieto fbd8698002 Add a few missing config setters and getters 2014-02-26 10:30:15 +01:00
Aidan Nulman 2656a72e82 Merge branch 'master' into custom_odb
Conflicts:
	git.go
	reference.go
	repository.go
	submodule.go
2014-02-24 03:05:44 -05:00
Aidan Nulman decaf064f9 add custom refdb backend support 2014-02-24 03:01:47 -05:00
lye 48a02566d6 Pre-emptively copy data when marshalling diff callback data.
When marshalling diff callback data to Go structs, any `char*` need to
be pre-emptively copied onto Go's heap as they're invalidated as soon as
our callback function returns. This patch adds this extra copy before
sending the value to the channel, which fixes a bug wherein
`DiffLine.Content`, `DiffFile.Path` and `DiffHunk.Header` would
previously return garbage data.
2014-02-23 18:51:56 -06:00
lye 375168abdc Export the constants and enumerations for diffs.
It is possible that the typed enums from libgit2 should be exported as
distinct types rather than numeric constants (e.g, `git_delta_t` and
`git_line_t` should be typed), but this has not been done in this patch.
2014-02-23 18:06:04 -06:00
Carlos Martín Nieto c6d1bde37c Return SubmoduleRecurse 2014-02-23 16:08:19 +01:00
Carlos Martín Nieto 0a1052b0e0 Merge pull request #52 from ursachec/master
Support for git_odb_hash.
2014-02-23 16:02:35 +01:00
Carlos Martín Nieto af80cc73ad Merge pull request #51 from Tobscher/master
added write method to index
2014-02-23 15:49:31 +01:00
Carlos Martín Nieto 8efcdd0e16 Merge pull request #55 from lye/add-is-x-reference-methods
Add Is$Type methods to Reference.
2014-02-23 15:43:02 +01:00
Carlos Martín Nieto 1b09b03c0e Merge commit 'refs/pull/53/head' of github.com:libgit2/git2go
On top: fix git_buf handling and rename signature

This fixes #57, #54.

Conflicts:
	git.go
	reference.go
	repository.go
	submodule.go
2014-02-23 15:31:22 +01:00
lye bc80beb843 Add partial diff/patch functionality.
This commit adds barebones capacity to generate diffs from two trees and
to emit those as git-style diffs (via `Patch.String`), or to enumerate
the files/hunks/lines in the diff to emit the data yourself.

The walk functions have been implemented in the same manner as the Odb
walking methods.

Note that not all of the functionality is implemented for either the
`git_diff_*` nor the `git_patch_*` functions, and there are unexposed
constants which would likely be useful to add.
2014-02-20 00:29:03 -06:00
lye 53b5ecacbe Add Is$Type methods to Reference.
This patch adds the following methods to Reference:

	IsBranch() bool
	IsRemote() bool
	IsTag() bool

which correspond to the `git_reference_is_$type` functions in libgit2.
2014-02-20 00:28:31 -06:00
Aidan Nulman 1c23e8ece3 add OdbBackend.Free() and the C it wraps; go fmt odb.go 2014-01-29 18:55:17 -05:00
Aidan Nulman d59f6d6d90 Merge branch 'catchupTo66af84' into custom_odb
Conflicts:
	git.go
	reference.go
	repository.go
	submodule.go
2014-01-29 18:10:38 -05:00
Aidan Nulman f66502aaf4 update git2go to support latest libgit2 development commit (id: 66af84) 2014-01-29 18:01:26 -05:00
Aidan Nulman f610cf25d7 Merge branch 'master' into custom_odb 2014-01-28 22:49:55 -05:00
Claudiu-Vlad Ursache bf209ca2ba Remove unnecessary cast. 2014-01-26 12:36:05 +01:00
Claudiu-Vlad Ursache 53f2ebce5f Test for Odb hash function. 2014-01-25 22:18:43 +01:00
Claudiu-Vlad Ursache 4ce2eb713b Add Odb hash function. 2014-01-25 22:18:32 +01:00
Tobias Haar 054268a634 added write method 2014-01-24 01:10:23 +00:00
Jason Toffaletti 32bf5f0a23 wip wrapping git_remote 2014-01-06 20:05:35 +00:00
Jason Toffaletti d124544668 minor 2014-01-06 16:55:29 +00:00
Jason Toffaletti 5d8a14d108 wrappers for git_cred, git_transfer_progress. don't call nil callbacks. 2014-01-05 20:55:32 +00:00
Jason Toffaletti e825d66fba work in progress wrapping git_clone 2014-01-04 00:40:21 +00:00
Jason Toffaletti 313e1126dd add git_submodule_recurse_t type 2014-01-02 23:33:08 +00:00
Aidan Nulman e686586149 remove unnecessary comment 2013-12-20 14:26:00 -05:00
Aidan Nulman 59c7bd5ce4 Add OdbBackend constructor 2013-12-20 14:11:24 -05:00
Aidan Nulman 507a204249 Rename constructor functions to New... 2013-12-19 17:24:44 -05:00
Aidan Nulman 19b241bd55 Refactor InitRepositoryWCustomOdbBackend() into component functions 2013-12-19 00:33:23 -05:00
Aidan Nulman dfe6d1ab7e Stop assuming ODB backend includes wrapping routine; wrap in git2go instead 2013-12-18 17:25:54 -05:00
Carlos Martín Nieto 66e1c47619 Merge pull request #41 from libgit2/cmn/threading
Lock the OS thread when acessing errors
2013-12-18 07:19:02 -08:00
Carlos Martín Nieto a40bdfd420 Lock the OS thread when acessing errors
The library stores error information in thread-local storage, which
means we need to make sure that the Go runtime doesn't switch OS
threads between the time we call a function and th time we attempt to
retrieve the error information.
2013-12-18 16:18:32 +01:00