Commit Graph

3167 Commits

Author SHA1 Message Date
Vicent Martí
b55fd885fc Merge pull request #941 from arrbee/diff-separate-iterators
Create a diff patch object as a replacement for iterators
2012-09-28 09:56:42 -07:00
Jameson Miller
addc9be4fc Fix error hashing empty file. 2012-09-27 13:12:27 -04:00
Michael Schubert
8060cdc93c revwalk: fix off-by-one error
Fixes #921.
2012-09-27 19:12:01 +02:00
Russell Belfer
bae957b95d Add const to all shared pointers in diff API
There are a lot of places where the diff API gives the user access
to internal data structures and many of these were being exposed
through non-const pointers.  This replaces them all with const
pointers for any object that the user can access but is still
owned internally to the git_diff_list or git_diff_patch objects.

This will probably break some bindings...  Sorry!
2012-09-25 16:35:05 -07:00
Russell Belfer
6428630865 Fix bugs in new diff patch code
This fixes all the bugs in the new diff patch code.  The only
really interesting one is that when we merge two diffs, we now
have to actually exclude diff delta records that are not supposed
to be tracked, as opposed to before where they could be included
because they would be skipped silently by `git_diff_foreach()`.
Other than that, there are just minor errors.
2012-09-25 16:35:05 -07:00
Russell Belfer
5f69a31f7d Initial implementation of new diff patch API
Replacing the `git_iterator` object, this creates a simple API
for accessing the "patch" for any file pair in a diff list and
then gives indexed access to the hunks in the patch and the lines
in the hunk.  This is the initial implementation of this revised
API - it is still broken, but at least builds cleanly.
2012-09-25 16:35:05 -07:00
Russell Belfer
9a12a6256e New take on iterating over diff content
Allow diff deltas to be accessed by index and make patch generation
explicit with hunk and line access by index as well.
2012-09-25 16:35:05 -07:00
Vicent Martí
5942bd18bf Merge pull request #947 from arrbee/public-error-set
Make giterr_set_str() and giterr_set_oom() public APIs
2012-09-25 14:53:13 -07:00
Vicent Martí
31d22037a6 Merge pull request #944 from scunz/list_tags
Tags: teach git_tag_list not to include the 'refs/tags/' prefix
2012-09-25 14:52:24 -07:00
Vicent Martí
3f7c5497c3 Merge pull request #938 from nulltoken/topic/is_valid_name
Topic/is valid name
2012-09-25 14:35:33 -07:00
nulltoken
0adfa20aef refspec: introduce git_refspec__parse() 2012-09-25 07:49:15 +02:00
nulltoken
77e06d7e85 refs: introduce git_reference_is_valid_name() 2012-09-25 07:49:15 +02:00
nulltoken
c030ada7ff refs: make git_reference_normalize_name() accept refspec pattern 2012-09-25 07:49:14 +02:00
Sascha Cunz
8469219e37 Tests: Add test for git_tag_list to check for 'git tag -l "*bar"' 2012-09-23 01:02:07 +02:00
Sascha Cunz
daa70138fc Tests: reindent object/tag/list.c to use tabs 2012-09-23 01:02:07 +02:00
Sascha Cunz
45949b378b Tests::object::tag: also test for a 'foo/*/bar'. 2012-09-23 01:02:07 +02:00
Sascha Cunz
7604ddbf70 Tests: Add 3 tags to resources/testrepo.
Adjusts refs::list test (including the comments)
Adjusts objects::tags::list test
2012-09-23 01:02:07 +02:00
Sascha Cunz
e800bbe80a Tests::Object::Tag: Add a mechanism to test which tags were returned
This patch changes the tag listing test helper to use a struct as input
parameter, which tells what we exactly expect.

As I don't think, we can rely on the fact that every os and every
filesystem will report the tags in the same order, I made this code
independent of the order that the tags are retrieved.
2012-09-23 00:00:55 +02:00
Sascha Cunz
f73f760e66 Tests::Object::Tag: move listing tags tests to an own file 2012-09-22 23:12:03 +02:00
Sascha Cunz
3af06254d0 Tags: teach git_tag_list not to include the 'refs/tags/' prefix
Since quite a while now, git_branch_foreach has learnt to list branches
without the 'refs/heads/' or 'refs/remotes' prefixes.
This patch teaches git_tag_list to do the same for listing tags.
2012-09-22 23:12:03 +02:00
Michael Schubert
d75074f4c0 Fix -Wmaybe-uninitialized warning 2012-09-22 12:29:16 +02:00
Russell Belfer
63f6c82568 Merge pull request #948 from csware/comment-fix
Make clear that git_odb_hashfile does not use filters
2012-09-21 16:20:41 -07:00
Sven Strickroth
f55af775ab Make clear that git_odb_hashfile does not use filters
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-22 01:16:10 +02:00
Russell Belfer
1a62810053 Make giterr_set_str public
There has been discussion for a while about making some set of
the `giterr_set` type functions part of the public API for code
that is implementing new backends to libgit2.  This makes the
`giterr_set_str()` and `giterr_set_oom()` functions public.
2012-09-21 15:04:39 -07:00
Russell Belfer
0cb24616ee Merge pull request #942 from nulltoken/topic/checkout-notify-skipped
checkout: add notification callback for skipped files
2012-09-21 10:51:42 -07:00
Russell Belfer
73f6da66af Merge pull request #943 from csware/only-close-open-filehandles
git_repository_hashfile: Only close file handle if we have a valid one
2012-09-21 10:42:53 -07:00
nulltoken
9e592583fc checkout: add notification callback for skipped files 2012-09-21 08:08:29 +02:00
Sven Strickroth
b1127a30c7 git_repository_hashfile: Only close file handle if we have a valid one
Otherwise this throws an exception on MFC based systems.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-20 22:32:19 +02:00
nulltoken
9ac8b113b1 Fix MSVC amd64 compilation warnings 2012-09-20 14:10:05 +02:00
nulltoken
28abf3dbd2 checkout: prefer mode_t type usage over int 2012-09-20 14:10:04 +02:00
Ben Straub
6340945186 ODB pack: snapshot last_found to avoid race
Also removed unnecessary refresh call and fixed
some indentation.
2012-09-19 04:55:16 -07:00
Ben Straub
78216495b0 Remove mtime checks from ODB packfile backend
Now forcing refresh on a foreach, and on missed full-oid
or short-oid lookups.
2012-09-19 04:41:30 -07:00
Ben Straub
5bb0dc9390 ODB: re-load packfiles on failed lookup
The old method was avoiding re-loading of packfiles by watching the mtime of the
pack directory. This causes the ODB to become stale if the directory and packfile
are written within the same clock millisecond, as when cloning a fairly small
repo.

This method tries to find the object in the cached packs, and forces a refresh when
that fails. This will cause extra stat'ing on a miss, but speeds up the success
case and avoids this race condition.
2012-09-19 04:41:24 -07:00
Philip Kelley
f08c60a518 Minor fixes for ignorecase support 2012-09-17 16:10:42 -04:00
Philip Kelley
ec40b7f99f Support for core.ignorecase 2012-09-17 15:42:41 -04:00
Russell Belfer
411cb017c2 Merge pull request #887 from nulltoken/topic/reset-hard
Checkout, reset and others enhancements
2012-09-17 11:38:33 -07:00
nulltoken
397837197d checkout: Mimic git_diff_options storage of paths 2012-09-17 20:27:28 +02:00
nulltoken
5e4cb4f4da checkout : reduce memory usage when not filtering 2012-09-17 10:48:36 +02:00
nulltoken
44af67a8b6 repository: introduce git_repository_set_head() 2012-09-17 10:48:35 +02:00
nulltoken
4ebe38bd58 repository: introduce git_repository_set_head_detached() 2012-09-17 10:48:35 +02:00
nulltoken
3f4c3072ea repository: introduce git_repository_detach_head() 2012-09-17 10:48:34 +02:00
nulltoken
cc548c7b0f repository: fix documentation typo 2012-09-17 10:48:33 +02:00
nulltoken
f1ad25f6df repository: separate head related tests 2012-09-17 10:48:32 +02:00
nulltoken
10df95c3ca checkout: add test coverage of dirs and subtrees 2012-09-17 10:48:31 +02:00
nulltoken
5af61863dd checkout: drop git_checkout_reference() 2012-09-17 10:48:30 +02:00
nulltoken
c214fa1caf checkout: segregate checkout strategies 2012-09-17 10:48:30 +02:00
nulltoken
020cda99c2 checkout: separate tree from index related tests 2012-09-17 10:48:29 +02:00
nulltoken
ee8bb8ba64 reset: add support for GIT_RESET_HARD mode 2012-09-17 10:48:28 +02:00
nulltoken
e93af30411 checkout: introduce git_checkout_index() 2012-09-17 10:48:27 +02:00
nulltoken
3aa443a951 checkout: introduce git_checkout_tree() 2012-09-17 10:48:26 +02:00