Commit Graph

3062 Commits

Author SHA1 Message Date
Josh Triplett
22408f4d5f git_note_oid: Fix the documentation to reference parameters using the correct names 2012-08-12 05:53:30 -07:00
Josh Triplett
b90202bbdd Fix incorrect array size in example for git_config_get_mapped
In the documentation for git_config_get_mapped, the sample mapping
array uses [3] but has 4 entries.  Fix by dropping the size entirely and
letting the compiler figure it out.
2012-08-12 03:56:15 -07:00
Vicent Martí
c9d78bde94 Merge pull request #863 from joshtriplett/export-git_attr_value
Export git_attr_value
2012-08-11 18:21:44 -07:00
Josh Triplett
5389005d93 Export git_attr_value
Commit 0c9eacf3d2 introduced the function
git_attr_value and switched the GIT_ATTR_* macros to use it, but
attempting to use that function leads to a linker error (undefined
reference to `git_attr_value').  Export git_attr_value so programs can
actually call it.
2012-08-11 18:14:07 -07:00
Michael Schubert
738837bdaa sha1: add missing header guards 2012-08-11 12:29:24 +02:00
Vicent Marti
c07d9c95f2 oid: Explicitly include oid.h for the inlined CMP 2012-08-09 15:33:04 -07:00
Russell Belfer
d7b3dab958 Merge pull request #861 from josh/parse-chomped-oid
Parse ref oids without trailing newline
2012-08-09 12:54:58 -07:00
Joshua Peek
de65f824cc Merge remote-tracking branch 'arrbee/rtrim-loose-refs' into parse-chomped-oid 2012-08-09 14:47:58 -05:00
Joshua Peek
186c054d65 Revert implementation changes 2012-08-09 14:47:29 -05:00
Joshua Peek
28e0068172 Ignore ref oid terminator 2012-08-09 14:39:56 -05:00
Joshua Peek
e60af90498 Test trailing space after ref oid 2012-08-09 14:39:43 -05:00
Russell Belfer
2fe293b6fb trim whitespace when parsing loose refs 2012-08-09 11:36:21 -07:00
Joshua Peek
6ab6829097 Parse ref oids without trailing newline 2012-08-09 12:39:09 -05:00
Russell Belfer
e4607392b5 Fix iterator check and return value
There is a little cleanup necessary from PR #843.  Since the
new callbacks return `GIT_EUSER` we have to be a little careful
about return values when they are used internally to the library.

Also, callbacks should be checked for non-zero return values,
not just less than zero.
2012-08-06 11:06:05 -07:00
Ben Straub
eb87800ab6 Checkout: fix memory leak in tests. 2012-08-06 09:34:17 -07:00
Vicent Marti
81f73a872c test: Open ODB on each test suite 2012-08-06 12:53:09 +02:00
Vicent Marti
d8d28e2ef6 remotes: Proper return for git_remote_ls 2012-08-06 12:44:23 +02:00
Vicent Marti
51e1d80846 Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development
Conflicts:
	src/notes.c
	src/transports/git.c
	src/transports/http.c
	src/transports/local.c
	tests-clar/odb/foreach.c
2012-08-06 12:41:08 +02:00
Michael Schubert
7e9f78b5fe remote: add missing include git2/remote.h
Otherwise we get an incomplete type error, since git_remote_callbacks
isn't declared yet.
2012-08-04 15:30:28 +02:00
Russell Belfer
b0d376695e Add new iteration behavior to git_tree_walk
Missed this one, ironically enough.
2012-08-03 17:24:59 -07:00
Russell Belfer
5dca201072 Update iterators for consistency across library
This updates all the `foreach()` type functions across the library
that take callbacks from the user to have a consistent behavior.
The rules are:

* A callback terminates the loop by returning any non-zero value
* Once the callback returns non-zero, it will not be called again
  (i.e. the loop stops all iteration regardless of state)
* If the callback returns non-zero, the parent fn returns GIT_EUSER
* Although the parent returns GIT_EUSER, no error will be set in
  the library and `giterr_last()` will return NULL if called.

This commit makes those changes across the library and adds tests
for most of the iteration APIs to make sure that they follow the
above rules.
2012-08-03 17:08:01 -07:00
Vicent Marti
5daca042c6 filebuf: Check the return value for close 2012-08-03 01:01:21 +02:00
Carlos Martín Nieto
d96c3863a5 win32: set errno to ENOENT or ENOTDIR when appropriate in do_lstat 2012-08-02 02:12:16 +02:00
Vicent Marti
e25dda51c4 Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/oid.c
2012-08-02 01:38:30 +02:00
Vicent Martí
95a1d87614 Merge pull request #850 from libgit2/attr-export
attr: Do not export variables externally
2012-08-01 16:31:00 -07:00
Vicent Marti
0ac349a9f3 repository: Indentation 2012-08-02 01:22:51 +02:00
Vicent Martí
e5f495012d Merge pull request #848 from carlosmn/pending-message
repository: add a getter and remove function for git's prepared message
2012-08-01 16:21:41 -07:00
Vicent Marti
0c9eacf3d2 attr: Do not export variables externally
Fixes #824

Exporting variables in a dynamic library is a PITA. Let's keep
these values internally and wrap them through a helper method.

This doesn't break the external API. @arrbee, aren't you glad I turned
the `GIT_ATTR_` macros into function macros? 
2012-08-02 01:15:24 +02:00
Vicent Martí
cf81ded61c Merge pull request #849 from scunz/git_caps
Add function to query for compile time settings.
2012-08-01 15:18:03 -07:00
Ben Straub
aa549d323e Clean up a TODO comment. 2012-08-01 15:09:05 -07:00
Sascha Cunz
e564e4969c Add function to query for compile time settings. 2012-08-01 20:02:32 +02:00
Carlos Martín Nieto
074841ec6a repository: add a getter and remove function for git's prepared message
The 'git revert/cherry-pick/merge -n' commands leave .git/MERGE_MSG
behind so that git-commit can find it. As we don't yet support these
operations, users who are shelling out to let git perform these
operations haven't had a convenient way to get this message.

These functions allow the user to retrieve the message and remove it
when she's created the commit.
2012-08-01 18:39:20 +02:00
Ben Straub
8b67f72b9c Add documentation for clone methods. 2012-07-31 21:25:48 -07:00
Ben Straub
5f4d2f9f65 Checkout: fix problem with detached HEAD. 2012-07-31 19:49:19 -07:00
Ben Straub
5280f4e698 Add checkout.h to git2.h.
Also correcting some documentation strings.
2012-07-31 19:39:06 -07:00
Ben Straub
78cd966aaf Checkout: fix crlf tests under win32. 2012-07-31 16:24:04 -07:00
Ben Straub
e4bac3c469 Checkout: crlf filter. 2012-07-31 15:38:12 -07:00
Ben Straub
8e4aae1ae5 Checkout: handle file modes properly.
Global file mode override now works properly with
the file mode stored in the tree node.
2012-07-31 10:46:38 -07:00
Vicent Martí
2340b18102 Merge pull request #826 from carlosmn/config-find-error
git_config_find_* does not set a git error
2012-07-31 10:19:30 -07:00
Vicent Martí
0565e7bdc4 Merge pull request #837 from carlosmn/travis
travis: be more idiomatic with the environment
2012-07-31 10:17:22 -07:00
Vicent Martí
bfb5916468 Merge pull request #833 from carlosmn/odb-one
odb: allow creating an ODB backend from a packfile index
2012-07-31 10:16:21 -07:00
Ben Straub
3f584b5027 Try to fix Travis. 2012-07-31 09:01:11 -07:00
Ben Straub
383fb799ee Rename example function to avoid name collision. 2012-07-31 08:51:38 -07:00
Ben Straub
7e02c7c56a Checkout: save index on checkout. 2012-07-31 08:45:42 -07:00
Vicent Martí
577cd8aec1 Merge pull request #840 from carlosmn/remote-unify
Unify the transport code
2012-07-30 16:17:35 -07:00
Ben Straub
4bf5115642 Enable stats on git_index_read_tree.
Replace with the contents of 
git_index_read_tree_with_stats() and improve
documentation comments.
2012-07-30 15:48:06 -07:00
Ben Straub
84595a30c0 Add clone to the network example. 2012-07-30 14:38:32 -07:00
Ben Straub
f1587b97a1 Checkout: use git_index_read_tree_with_stats.
New variant of git_index_read_tree that fills in
the 'total' field of a git_indexer_stats struct
as it's walking the tree.
2012-07-30 14:37:40 -07:00
Carlos Martín Nieto
0048372a9a transport: rename encrypt to use_ssl
SSL isn't the only way that a transport can be encrypted. The new name
will make it easier to merge the SSH support.
2012-07-30 20:28:16 +02:00
Carlos Martín Nieto
3e3228b6d6 fetch: remove timeout code 2012-07-30 20:28:16 +02:00