]> git.proxmox.com Git - libgit2.git/log
libgit2.git
12 years agorepository: make initialization cope with missing core.worktree
nulltoken [Wed, 29 Aug 2012 12:20:53 +0000 (14:20 +0200)]
repository: make initialization cope with missing core.worktree

12 years agoMerge pull request #905 from carlosmn/signature-now
Vicent Martí [Tue, 28 Aug 2012 20:55:55 +0000 (13:55 -0700)]
Merge pull request #905 from carlosmn/signature-now

signature: make the OS give us the offset for git_signature_now

12 years agoFix parentheses warning
Michael Schubert [Tue, 28 Aug 2012 18:15:21 +0000 (20:15 +0200)]
Fix parentheses warning

12 years agosignature: make the OS give us the offset for git_signature_now
Carlos Martín Nieto [Tue, 28 Aug 2012 16:02:12 +0000 (18:02 +0200)]
signature: make the OS give us the offset for git_signature_now

There is a better and less fragile way to calculate time offsets. Let
the OS take care of dealing with DST and simply take the the offset
between the local time and UTC that it gives us.

12 years agossl: make cert check ignore work for invalid certs, not just CNs
Carlos Martín Nieto [Tue, 28 Aug 2012 12:15:32 +0000 (14:15 +0200)]
ssl: make cert check ignore work for invalid certs, not just CNs

Passing SSL_VERIFY_PEER makes OpenSSL shut down the connection if the
certificate is invalid, without giving us a chance to ignore that
error. Pass SSL_VERIFY_NONE and call SSL_get_verify_result if the user
wanted us to check.

When no CNs match, we used to jump to on_error which gave a bogus
error as that's for OpenSSL errors. Jump to cert_fail so we tell the
user that the error came from checking the certificate.

12 years agoMerge branch 'branch-delete-ref' into development
Vicent Marti [Mon, 27 Aug 2012 21:54:52 +0000 (14:54 -0700)]
Merge branch 'branch-delete-ref' into development

Conflicts:
include/git2/refs.h

12 years agoMerge pull request #904 from arrbee/better-object-peel
Vicent Martí [Mon, 27 Aug 2012 21:52:26 +0000 (14:52 -0700)]
Merge pull request #904 from arrbee/better-object-peel

Make git_object_peel a bit smarter

12 years agoMerge pull request #897 from nulltoken/topic/git_reference_check_format
Vicent Martí [Mon, 27 Aug 2012 20:39:17 +0000 (13:39 -0700)]
Merge pull request #897 from nulltoken/topic/git_reference_check_format

refs: expose git_reference_normalize_name()

12 years agoMerge pull request #899 from schu/revwalk-push
Vicent Martí [Mon, 27 Aug 2012 20:35:58 +0000 (13:35 -0700)]
Merge pull request #899 from schu/revwalk-push

revwalk: refuse push of non-commit objects

12 years agoMake git_object_peel a bit smarter
Russell Belfer [Mon, 27 Aug 2012 18:53:59 +0000 (11:53 -0700)]
Make git_object_peel a bit smarter

This expands the types of peeling that `git_object_peel` knows
how to do to include TAG -> BLOB peeling, and makes the errors
slightly more consistent depending on the situation.  It also
adds a new special behavior where peeling to ANY will peel until
the object type changes (e.g. chases TAGs to a non-TAG).

Using this expanded peeling, this replaces peeling code that was
embedded in `git_tag_peel` and `git_reset`.

12 years agoMerge pull request #903 from nulltoken/topic/peeling-duplication
Russell Belfer [Mon, 27 Aug 2012 18:45:48 +0000 (11:45 -0700)]
Merge pull request #903 from nulltoken/topic/peeling-duplication

branch: reduce code duplication

12 years agobranch: reduce code duplication
nulltoken [Mon, 27 Aug 2012 13:24:27 +0000 (15:24 +0200)]
branch: reduce code duplication

12 years agorevwalk: refuse push of non-commit objects
Michael Schubert [Mon, 27 Aug 2012 08:51:01 +0000 (10:51 +0200)]
revwalk: refuse push of non-commit objects

Check the type of the pushed object immediately instead of starting the
walk and failing in between.

12 years agorefs: expose git_reference_normalize_name()
nulltoken [Sun, 26 Aug 2012 20:08:22 +0000 (22:08 +0200)]
refs: expose git_reference_normalize_name()

12 years agobranch: Change `git_branch_delete` to take a ref
Vicent Marti [Thu, 23 Aug 2012 22:47:29 +0000 (15:47 -0700)]
branch: Change `git_branch_delete` to take a ref

12 years agoposix: Always set a default mapping mode
Vicent Marti [Thu, 23 Aug 2012 22:47:08 +0000 (15:47 -0700)]
posix: Always set a default mapping mode

12 years agoindexer: kill git_indexer_stats.data_received
Carlos Martín Nieto [Sat, 25 Aug 2012 22:35:52 +0000 (00:35 +0200)]
indexer: kill git_indexer_stats.data_received

It's not really needed with the current code as we have EOS and the
sideband's flush to tell us we're done.

Keep the distinction between processed and received objects.

12 years agohttp: increase buffer side to deal with side-band-64k
Carlos Martín Nieto [Sat, 25 Aug 2012 21:32:19 +0000 (23:32 +0200)]
http: increase buffer side to deal with side-band-64k

This poor transport was forgotten in the recent sideband support.

12 years agoindexer: don't segfault when freeing an unused indexer
Carlos Martín Nieto [Sat, 25 Aug 2012 21:31:29 +0000 (23:31 +0200)]
indexer: don't segfault when freeing an unused indexer

Make sure that idx->pack isn't NULL before trying to free resources
under it.

12 years agoMerge pull request #896 from ben/revparse-ambiguous
Vicent Martí [Sat, 25 Aug 2012 18:37:23 +0000 (11:37 -0700)]
Merge pull request #896 from ben/revparse-ambiguous

Revparse: GIT_EAMBIGUOUS

12 years agoRevparse: GIT_EAMBIGUOUS
Ben Straub [Thu, 23 Aug 2012 19:29:09 +0000 (12:29 -0700)]
Revparse: GIT_EAMBIGUOUS

Revparse now returns EAMBIGUOUS if the the spec
doesn't match any refs/tags, and is <4 characters.

12 years agoMerge pull request #895 from carlosmn/sideband
Vicent Martí [Fri, 24 Aug 2012 23:29:01 +0000 (16:29 -0700)]
Merge pull request #895 from carlosmn/sideband

Add sideband support

12 years agoMerge pull request #852 from arrbee/submodule-extensions
Vicent Martí [Fri, 24 Aug 2012 22:45:13 +0000 (15:45 -0700)]
Merge pull request #852 from arrbee/submodule-extensions

Submodule extensions

12 years agoMerge pull request #876 from arrbee/new-config-locations
Vicent Martí [Fri, 24 Aug 2012 22:43:19 +0000 (15:43 -0700)]
Merge pull request #876 from arrbee/new-config-locations

new config file locations and defaults

12 years agoSupport new config locations
Russell Belfer [Fri, 24 Aug 2012 21:32:45 +0000 (14:32 -0700)]
Support new config locations

As of git v1.7.12, $HOME/.config/git/ is supported as a new
location for "config", "attributes", and "ignore" files.

12 years agoFix memory leak in cp_r
Russell Belfer [Fri, 24 Aug 2012 21:24:33 +0000 (14:24 -0700)]
Fix memory leak in cp_r

12 years agoFix crash with adding internal ignores
Russell Belfer [Fri, 24 Aug 2012 20:41:45 +0000 (13:41 -0700)]
Fix crash with adding internal ignores

Depending on what you had done before adding new items to the
internal ignores list, it was possible for the cache of ignore
data to be uninitialized.

12 years agoFix valgrind warnings and spurious error messages
Russell Belfer [Fri, 24 Aug 2012 19:19:22 +0000 (12:19 -0700)]
Fix valgrind warnings and spurious error messages

Just clean up valgrind warnings about uninitialized memory
and also clear out errno in some cases where it results in
a false error message being generated at a later point.

12 years agoexamples: add progress output to fetch
Carlos Martín Nieto [Mon, 14 May 2012 18:46:30 +0000 (20:46 +0200)]
examples: add progress output to fetch

12 years agonetwork: add sideband support
Carlos Martín Nieto [Mon, 14 May 2012 15:54:25 +0000 (17:54 +0200)]
network: add sideband support

This lets us notify the user of what the remote end is doing while we
wait for it to start sending us the packfile.

12 years agoWorking implementation of git_submodule_status
Russell Belfer [Fri, 10 Aug 2012 02:43:25 +0000 (19:43 -0700)]
Working implementation of git_submodule_status

This is a big redesign of the git_submodule_status API and the
implementation of the redesigned API.  It also fixes a number of
bugs that I found in other parts of the submodule API while
writing the tests for the status part.

This also fixes a couple of bugs in the iterators that had not
been noticed before - one with iterating when there is a gitlink
(i.e. separate-work-dir) and one where I was treating anything
even vaguely submodule-like as a submodule, more aggressively
than core git does.

12 years agoFix valgrind issues and leaks
Russell Belfer [Fri, 3 Aug 2012 21:28:07 +0000 (14:28 -0700)]
Fix valgrind issues and leaks

This fixes up a number of problems flagged by valgrind and also
cleans up the internal `git_submodule` allocation handling
overall with a simpler model.

12 years agoMajor submodule rewrite
Russell Belfer [Thu, 2 Aug 2012 20:00:58 +0000 (13:00 -0700)]
Major submodule rewrite

This replaces the old submodule API with a new extended API that
supports most of the things that can be done with `git submodule`.

12 years agoNew submodule test data
Russell Belfer [Wed, 18 Jul 2012 21:30:15 +0000 (14:30 -0700)]
New submodule test data

12 years agoFix errors on Win32 with new repo init
Russell Belfer [Fri, 24 Aug 2012 17:48:48 +0000 (10:48 -0700)]
Fix errors on Win32 with new repo init

12 years agoindexer: recognize and mark when all of the packfile has been downloaded
Carlos Martín Nieto [Fri, 13 Jul 2012 10:01:11 +0000 (12:01 +0200)]
indexer: recognize and mark when all of the packfile has been downloaded

We can't always rely on the network telling us when the download is
finished. Recognize it from the indexer itself.

12 years agoMerge pull request #844 from arrbee/init-extended
Vicent Martí [Thu, 23 Aug 2012 21:10:47 +0000 (14:10 -0700)]
Merge pull request #844 from arrbee/init-extended

Add git_repository_init_ext for power initters

12 years agoFix warnings and merge issues on Win64
Russell Belfer [Thu, 23 Aug 2012 16:20:17 +0000 (09:20 -0700)]
Fix warnings and merge issues on Win64

12 years agoSome cleanup suggested during review
Russell Belfer [Wed, 22 Aug 2012 23:03:35 +0000 (16:03 -0700)]
Some cleanup suggested during review

This cleans up a number of items suggested during code review
with @vmg, including:

* renaming "outside repo" config API to `git_config_open_default`
* killing the `git_config_open_global` API
* removing the `git_` prefix from the static functions in fileops
* removing some unnecessary functionality from the "cp" command

12 years agoDon't reference stack vars in cleanup callback
Russell Belfer [Wed, 1 Aug 2012 21:49:47 +0000 (14:49 -0700)]
Don't reference stack vars in cleanup callback

If you use the clar cleanup callback function, you can't pass a
reference pointer to a stack allocated variable because when the
cleanup function runs, the stack won't exist anymore.

12 years agofix missing validation and type cast warning
Russell Belfer [Wed, 1 Aug 2012 21:30:08 +0000 (14:30 -0700)]
fix missing validation and type cast warning

12 years agoAdd template dir and set gid to repo init
Russell Belfer [Wed, 1 Aug 2012 00:02:54 +0000 (17:02 -0700)]
Add template dir and set gid to repo init

This extends git_repository_init_ext further with support for
initializing the repository from an external template directory
and with support for the "create shared" type flags that make a
set GID repository directory.

This also adds tests for much of the new functionality to the
existing `repo/init.c` test suite.

Also, this adds a bunch of new utility functions including a
very general purpose `git_futils_mkdir` (with the ability to
make paths and to chmod the paths post-creation) and a file
tree copying function `git_futils_cp_r`.  Also, this includes
some new path functions that were useful to keep the code
simple.

12 years agoAdd git_repository_init_ext for power initters
Russell Belfer [Thu, 26 Jul 2012 23:07:01 +0000 (16:07 -0700)]
Add git_repository_init_ext for power initters

The extended version of repository init adds support for many
of the things that you can do with `git init` and sets up
structures that will make it easier to extend further in the
future.

12 years agoMinor bug fixes in diff code
Russell Belfer [Wed, 22 Aug 2012 20:57:57 +0000 (13:57 -0700)]
Minor bug fixes in diff code

In looking at PR #878, I found a few small bugs in the diff code,
mostly related to work that can be avoided when processing tree-
to-tree diffs that was always being carried out.  This commit has
some small fixes in it.

12 years agoMerge pull request #891 from arrbee/internal-ignore-api
Vicent Martí [Wed, 22 Aug 2012 20:15:14 +0000 (13:15 -0700)]
Merge pull request #891 from arrbee/internal-ignore-api

API for managing in-memory ignore rules

12 years agoWrap up ignore API and add tests
Russell Belfer [Wed, 22 Aug 2012 18:42:00 +0000 (11:42 -0700)]
Wrap up ignore API and add tests

This fills out the ignore API and adds tests.

12 years agoAdd public API for internal ignores
Russell Belfer [Wed, 22 Aug 2012 00:26:39 +0000 (17:26 -0700)]
Add public API for internal ignores

This creates a public API for adding to the internal ignores
list, which already existing but was not accessible.

This adds the new default value for core.excludesfile also.

12 years agoMerge pull request #889 from nulltoken/filemode-enum
Vicent Martí [Tue, 21 Aug 2012 21:32:09 +0000 (14:32 -0700)]
Merge pull request #889 from nulltoken/filemode-enum

Filemode enum

12 years agotree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
nulltoken [Tue, 21 Aug 2012 09:45:16 +0000 (11:45 +0200)]
tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()

12 years agofilemode: deploy enum usage
nulltoken [Fri, 17 Aug 2012 19:10:32 +0000 (21:10 +0200)]
filemode: deploy enum usage

12 years agofilemode: introduce enum to ease use of attributes
nulltoken [Fri, 17 Aug 2012 19:15:32 +0000 (21:15 +0200)]
filemode: introduce enum to ease use of attributes

12 years agoWin32: test core.autocrlf
Ben Straub [Tue, 21 Aug 2012 17:10:32 +0000 (10:10 -0700)]
Win32: test core.autocrlf

12 years agoTests: close file handles before asserting
Ben Straub [Tue, 21 Aug 2012 03:24:20 +0000 (20:24 -0700)]
Tests: close file handles before asserting

Avoids getting ERROR_SHARING_VIOLATION on win32
and killing the entire clar run.

12 years agoMerge pull request #884 from carlosmn/global-windows
Vicent Martí [Mon, 20 Aug 2012 19:10:23 +0000 (12:10 -0700)]
Merge pull request #884 from carlosmn/global-windows

Make the memory-window conrol structures global

12 years agoMake the memory-window conrol structures global
Carlos Martín Nieto [Sat, 18 Aug 2012 20:11:49 +0000 (22:11 +0200)]
Make the memory-window conrol structures global

Up to now, the idea was that the user would do all the operations for
one repository in the same thread. Thus we could have the
memory-mapped window information thread-local and avoid any locking.

This is not practical in a few environments, such as Apple's GCD which
allocates threads arbitrarily or the .NET CLR, where the OS-level
thread can change at any moment.

Make the control structure global and protect it with a mutex so we
don't depend on the thread currently executing the code.

12 years agoMerge pull request #879 from nulltoken/deprecated-mode
Vicent Martí [Sun, 19 Aug 2012 22:12:43 +0000 (15:12 -0700)]
Merge pull request #879 from nulltoken/deprecated-mode

Handling of 100664 deprecated mode in tree entries

12 years agotreebuilder: enhance attributes handling on insertion
nulltoken [Fri, 17 Aug 2012 09:21:49 +0000 (11:21 +0200)]
treebuilder: enhance attributes handling on insertion

12 years agoAdd deprecated-mode.git test repository
nulltoken [Thu, 16 Aug 2012 09:53:24 +0000 (11:53 +0200)]
Add deprecated-mode.git test repository

12 years agoMerge pull request #778 from ben/clone
Vicent Martí [Sun, 19 Aug 2012 08:26:06 +0000 (01:26 -0700)]
Merge pull request #778 from ben/clone

Clone

12 years agoMerge pull request #877 from nulltoken/minor-fixes
Vicent Martí [Wed, 15 Aug 2012 21:34:49 +0000 (14:34 -0700)]
Merge pull request #877 from nulltoken/minor-fixes

Minor fixes

12 years agorefs: fix missing parameter documentation
nulltoken [Wed, 15 Aug 2012 15:54:05 +0000 (17:54 +0200)]
refs: fix missing parameter documentation

12 years agonotes: slight documentation enhancements
nulltoken [Wed, 15 Aug 2012 15:50:02 +0000 (17:50 +0200)]
notes: slight documentation enhancements

12 years agoFix compilation warning
nulltoken [Tue, 14 Aug 2012 22:08:38 +0000 (00:08 +0200)]
Fix compilation warning

12 years agotests: fix tree walking test
Carlos Martín Nieto [Tue, 14 Aug 2012 18:54:13 +0000 (20:54 +0200)]
tests: fix tree walking test

Return -1 to stop the iteration instead of not-0

12 years agoMerge pull request #873 from carlosmn/tree-walk
Carlos Martín Nieto [Tue, 14 Aug 2012 18:43:20 +0000 (11:43 -0700)]
Merge pull request #873 from carlosmn/tree-walk

git_tree_walk callback return value semantic does not match documentation

12 years agoMerge pull request #875 from arrbee/fix-message-prettify-length-check
Russell Belfer [Tue, 14 Aug 2012 18:30:18 +0000 (11:30 -0700)]
Merge pull request #875 from arrbee/fix-message-prettify-length-check

Fix message prettify length check

12 years agoMake git_message_prettify return bytes written
Russell Belfer [Tue, 14 Aug 2012 17:50:58 +0000 (10:50 -0700)]
Make git_message_prettify return bytes written

If you want to be absolutely safe with git_message_prettify, you
can now pass a NULL pointer for the buffer and get back the number
of bytes that would be copied into the buffer.

This means that an error is a non-negative return code and a
success will be greater than zero from this function.

12 years agoMerge pull request #871 from joshtriplett/fix-note_foreach-docs
Vicent Martí [Tue, 14 Aug 2012 04:04:27 +0000 (21:04 -0700)]
Merge pull request #871 from joshtriplett/fix-note_foreach-docs

git_note_foreach: Fix documentation for notes_ref parameter

12 years agoMerge pull request #870 from joshtriplett/fix-note_create-docs
Vicent Martí [Tue, 14 Aug 2012 04:02:35 +0000 (21:02 -0700)]
Merge pull request #870 from joshtriplett/fix-note_create-docs

git_note_oid: Fix the documentation to reference parameters using the correct names

12 years agoMerge pull request #872 from joshtriplett/fix-note_remove-docs
Vicent Martí [Tue, 14 Aug 2012 04:02:12 +0000 (21:02 -0700)]
Merge pull request #872 from joshtriplett/fix-note_remove-docs

git_note_create: Copyediting on documentation for the oid parameter

12 years agoMerge pull request #867 from joshtriplett/fix-array-size-for-git_config_get_mapped
Vicent Martí [Tue, 14 Aug 2012 04:01:24 +0000 (21:01 -0700)]
Merge pull request #867 from joshtriplett/fix-array-size-for-git_config_get_mapped

Fix incorrect array size in example for git_config_get_mapped

12 years agoMerge pull request #866 from arrbee/fix-config-file-parsing
Vicent Martí [Tue, 14 Aug 2012 03:56:28 +0000 (20:56 -0700)]
Merge pull request #866 from arrbee/fix-config-file-parsing

Config file parser includes = in name if no space around it

12 years agotree: allow the user to skip an entry or cancel the walk
Carlos Martín Nieto [Mon, 13 Aug 2012 12:07:47 +0000 (14:07 +0200)]
tree: allow the user to skip an entry or cancel the walk

Returning a negative cancels the walk, and returning a positive one
causes us to skip an entry, which was previously done by a negative
value.

This allows us to stay consistent with the rest of the functions that
take a callback and keeps the skipping functionality.

12 years agotree: bring back the documented behaviour for a walk
Carlos Martín Nieto [Mon, 13 Aug 2012 12:00:53 +0000 (14:00 +0200)]
tree: bring back the documented behaviour for a walk

However, there should be a way to cancel the walk and another to skip
the entry.

12 years agoClean up code
Russell Belfer [Sun, 12 Aug 2012 18:53:58 +0000 (11:53 -0700)]
Clean up code

Okay, this is probably cleaner and it is also less net change
from the original version

12 years agogit_note_remove: Copyediting on documentation for the oid parameter
Josh Triplett [Sun, 12 Aug 2012 14:06:11 +0000 (07:06 -0700)]
git_note_remove: Copyediting on documentation for the oid parameter

12 years agoCheck prettify message output buffer after cleanup
Russell Belfer [Sun, 12 Aug 2012 16:08:45 +0000 (09:08 -0700)]
Check prettify message output buffer after cleanup

This makes the message prettify buffer length check accurate.

12 years agoFix config parser boundary logic
Russell Belfer [Sun, 12 Aug 2012 14:59:30 +0000 (07:59 -0700)]
Fix config parser boundary logic

The config file parser was not working right if there was no
whitespace between the value name and the equals sign.  This
fixes that.

12 years agogit_note_foreach: Fix documentation for notes_ref parameter
Josh Triplett [Sun, 12 Aug 2012 13:31:42 +0000 (06:31 -0700)]
git_note_foreach: Fix documentation for notes_ref parameter

12 years agogit_note_oid: Fix the documentation to reference parameters using the correct names
Josh Triplett [Sun, 12 Aug 2012 12:53:30 +0000 (05:53 -0700)]
git_note_oid: Fix the documentation to reference parameters using the correct names

12 years agoFix incorrect array size in example for git_config_get_mapped
Josh Triplett [Sun, 12 Aug 2012 10:56:15 +0000 (03:56 -0700)]
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.

12 years agoMerge pull request #863 from joshtriplett/export-git_attr_value
Vicent Martí [Sun, 12 Aug 2012 01:21:44 +0000 (18:21 -0700)]
Merge pull request #863 from joshtriplett/export-git_attr_value

Export git_attr_value

12 years agoExport git_attr_value
Josh Triplett [Sun, 12 Aug 2012 01:14:07 +0000 (18:14 -0700)]
Export git_attr_value

Commit 0c9eacf3d2c83256736a5bb2a240e73afd13d55f 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.

12 years agosha1: add missing header guards
Michael Schubert [Sat, 11 Aug 2012 10:29:24 +0000 (12:29 +0200)]
sha1: add missing header guards

12 years agooid: Explicitly include `oid.h` for the inlined CMP
Vicent Marti [Thu, 9 Aug 2012 22:33:04 +0000 (15:33 -0700)]
oid: Explicitly include `oid.h` for the inlined CMP

12 years agoMerge pull request #861 from josh/parse-chomped-oid
Russell Belfer [Thu, 9 Aug 2012 19:54:58 +0000 (12:54 -0700)]
Merge pull request #861 from josh/parse-chomped-oid

Parse ref oids without trailing newline

12 years agoMerge remote-tracking branch 'arrbee/rtrim-loose-refs' into parse-chomped-oid
Joshua Peek [Thu, 9 Aug 2012 19:47:58 +0000 (14:47 -0500)]
Merge remote-tracking branch 'arrbee/rtrim-loose-refs' into parse-chomped-oid

12 years agoRevert implementation changes
Joshua Peek [Thu, 9 Aug 2012 19:47:29 +0000 (14:47 -0500)]
Revert implementation changes

12 years agoIgnore ref oid terminator
Joshua Peek [Thu, 9 Aug 2012 19:39:56 +0000 (14:39 -0500)]
Ignore ref oid terminator

12 years agoTest trailing space after ref oid
Joshua Peek [Thu, 9 Aug 2012 19:39:43 +0000 (14:39 -0500)]
Test trailing space after ref oid

12 years agotrim whitespace when parsing loose refs
Russell Belfer [Thu, 9 Aug 2012 18:36:21 +0000 (11:36 -0700)]
trim whitespace when parsing loose refs

12 years agoParse ref oids without trailing newline
Joshua Peek [Thu, 9 Aug 2012 17:39:09 +0000 (12:39 -0500)]
Parse ref oids without trailing newline

12 years agoFix iterator check and return value
Russell Belfer [Mon, 6 Aug 2012 18:06:05 +0000 (11:06 -0700)]
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.

12 years agoCheckout: fix memory leak in tests.
Ben Straub [Mon, 6 Aug 2012 16:34:17 +0000 (09:34 -0700)]
Checkout: fix memory leak in tests.

12 years agotest: Open ODB on each test suite
Vicent Marti [Mon, 6 Aug 2012 10:53:09 +0000 (12:53 +0200)]
test: Open ODB on each test suite

12 years agoremotes: Proper return for `git_remote_ls`
Vicent Marti [Mon, 6 Aug 2012 10:44:23 +0000 (12:44 +0200)]
remotes: Proper return for `git_remote_ls`

12 years agoMerge remote-tracking branch 'arrbee/tree-walk-fixes' into development
Vicent Marti [Mon, 6 Aug 2012 10:41:08 +0000 (12:41 +0200)]
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

12 years agoremote: add missing include git2/remote.h
Michael Schubert [Sat, 4 Aug 2012 13:22:38 +0000 (15:22 +0200)]
remote: add missing include git2/remote.h

Otherwise we get an incomplete type error, since git_remote_callbacks
isn't declared yet.

12 years agoAdd new iteration behavior to git_tree_walk
Russell Belfer [Sat, 4 Aug 2012 00:24:59 +0000 (17:24 -0700)]
Add new iteration behavior to git_tree_walk

Missed this one, ironically enough.

12 years agoUpdate iterators for consistency across library
Russell Belfer [Sat, 4 Aug 2012 00:08:01 +0000 (17:08 -0700)]
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.