Commit Graph

3395 Commits

Author SHA1 Message Date
Russell Belfer
7c411fd9b2 Fix up more Win64 compile warnings 2012-10-01 12:32:55 -07:00
Vicent Marti
93b5fabcc0 threads: Assert that the global state is initialized 2012-10-01 17:59:04 +02:00
Vicent Marti
9063be1f45 remote: Fix mid-block declaration 2012-10-01 17:33:05 +02:00
Vicent Martí
bdaa40d3da Merge pull request #957 from carlosmn/include-tag
Include tag
2012-10-01 08:28:46 -07:00
Carlos Martín Nieto
3230a44f4c remote: support downloading all tags
Also honor remote.$name.tagopt = --tags.
2012-09-30 12:05:28 +02:00
Carlos Martín Nieto
eb0bd77a88 remote: use the refspec functions to parse, instead of rolling our own
The local function works for simple cases, but we shouldn't reinvent
the wheel just for us.
2012-09-30 12:04:49 +02:00
Carlos Martín Nieto
f70e466f68 remote: add accessors for the autotag setting 2012-09-30 12:04:49 +02:00
Carlos Martín Nieto
a37ddf7ef8 remote: create tags if we have them
Together with include-tag, this make us behave more like git. After a
fetch, try to create any tags the remote told us about for which we
have objects locally.
2012-09-30 12:04:39 +02:00
Carlos Martín Nieto
24f2f94e7d fetch: use the include-tag capability
This tells the remote to send us any tags that point to objects that
we are downloading.
2012-09-30 11:56:38 +02:00
Carlos Martín Nieto
c128149315 refs: propagate EEXISTS
Indicate whether the error comes from the ref already existing or
elsewhere. We always perform the check and this lets the user write
more concise code.
2012-09-30 11:56:37 +02:00
Carlos Martín Nieto
3665ba8eeb refspec: add git_refspec__free, remove git_refspec_parse
The latter shouldn't be exposed and isn't used, git_refspec__parse
supersedes it.

Fix a leak in the refspec tests while we're at it.
2012-09-30 11:56:37 +02:00
Carlos Martín Nieto
2af1c26641 examples: fix config getter param order 2012-09-30 11:02:53 +02:00
Sven Strickroth
19aa8416e5 Silence MinGW warnings
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-29 21:31:19 +02:00
Sven Strickroth
dee18b825a Added win32_ prefix for Win32-only methods
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-29 21:26:04 +02:00
Sven Strickroth
77ddd4ccc3 Make it compile with MinGW on Windows
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-29 21:24:07 +02:00
Sven Strickroth
32a4e3b712 Move code to find msysgit path using registry to own method
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-29 20:26:33 +02:00
Sven Strickroth
549ee21a6f Find git installations based on %PATH%
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-29 20:20:41 +02:00
Russell Belfer
cc5bf359a6 Clean up Win64 warnings 2012-09-28 14:34:08 -07:00
Vicent Martí
34402bcdb9 Merge pull request #959 from jamill/empty_file_hash
Fix error hashing empty file.
2012-09-28 11:57:02 -07:00
Vicent Martí
3f849902e4 Merge pull request #958 from schu/fix-merge-base
revwalk: fix off-by-one error
2012-09-28 11:48:43 -07:00
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
Sven Strickroth
f2b126c76e Implemented the full msysgit fallback chain
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-25 00:33:53 +02:00
Sven Strickroth
c378a1184e git_config_open_default: Honour xdr config
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-25 00:11:53 +02:00
Sven Strickroth
d7940ac3e4 Fixed missing method
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-25 00:09:44 +02:00
Sven Strickroth
407cf4e414 Fixed typo: xdr config needs to have a lower priority than the global one
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 23:22:07 +02:00
Sven Strickroth
8b4f9b1758 Correctly read xdr compatible %HOME%/.config/git/config config file
This file is not just read if the global config file (%HOME%/.gitconfig)
is not found, however, it is used everytime but with lower priority.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 18:59:00 +02:00
Sven Strickroth
6605f51d81 Automatically detect msysgit installation path
Do not hardcode the installation path of msysgit, but read installation path from registry.
Also "%PROGRAMFILES%\Git\etc" won't work on x64 systems with 64-bit libgit2, because
msysgit is x86 only and located in "%ProgramFiles(x86)%\Git\etc".

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 18:50:37 +02:00
Sven Strickroth
68e75c3a57 Calculate the Windows user profile directory the same way as msysgit
On most systems %USERPROFILE% is the same as %HOMEDRIVE%\%HOMEPATH%,
however, for windows machines in an AD or domain environment this
might be different and %HOMEDRIVE%\%HOMEPATH% seems to be better.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 18:06:34 +02:00
Sven Strickroth
aed8f8a101 Honor %HOME% on windows
Use %HOME% before trying to figure out the windows user directory.
Users might set this as they are used on *nix systems.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-24 18:02:47 +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