Commit Graph

1139 Commits

Author SHA1 Message Date
Vicent Marti
cf9709b64e tests: Do not warn for unused variable 2013-04-22 16:53:46 +02:00
Vicent Marti
865e2dd444 tests: Cleanup commit parse testing code 2013-04-22 16:52:07 +02:00
Russell Belfer
38eef6113d Make indexer use shared packfile open code
The indexer was creating a packfile object separately from the
code in pack.c which was a problem since I put a call to
git_mutex_init into just pack.c.  This commit updates the pack
function for creating a new pack object (i.e. git_packfile_check())
so that it can be used in both places and then makes indexer.c
use the shared initialization routine.

There are also a few minor formatting and warning message fixes.
2013-04-22 16:52:07 +02:00
Russell Belfer
3f27127d15 Simplify object table parse functions
This unifies the object parse functions into one signature that
takes an odb_object.
2013-04-22 16:52:06 +02:00
Russell Belfer
786062639f Add callback to git_objects_table
This adds create and free callback to the git_objects_table so
that more of the creation and destruction of objects can be table
driven instead of using switch statements.  This also makes the
semantics of certain object creation functions consistent so that
we can make better use of function pointers.  This also fixes a
theoretical error case where an object allocation fails and we
end up storing NULL into the cache.
2013-04-22 16:51:40 +02:00
Russell Belfer
917f60c50b Add tests for oidmap and new cache with threading
This adds some basic tests for the oidmap just to make sure that
collisions, etc. are dealt with correctly.

This also adds some tests for the new caching that check if items
are inserted (or not inserted) properly into the cache, and that
the cache can hold up in a multithreaded environment without error.
2013-04-22 16:50:51 +02:00
Vicent Marti
8842c75f17 What has science done. 2013-04-22 16:50:50 +02:00
Vicent Marti
5df184241a lol this worked first try wtf 2013-04-22 16:50:50 +02:00
Vicent Martí
a472f887fe Merge pull request #1493 from carlosmn/remotes
Revamp the refspec handling
2013-04-22 07:44:32 -07:00
Russell Belfer
21ca045100 Move git_reference__alloc to include/git2/sys
Create a new include/git2/sys/refs.h and move the reference alloc
functions there.  Also fix some documentation issues and some
minor code cleanups.
2013-04-21 12:52:17 -07:00
Russell Belfer
4dcd878019 Move refdb_backend to include/git2/sys
This moves most of the refdb stuff over to the include/git2/sys
directory, with some minor shifts in function organization.

While I was making the necessary updates, I also removed the
trailing whitespace in a few files that I modified just because I
was there and it was bugging me.
2013-04-21 11:57:21 -07:00
Russell Belfer
1384b688d0 Move some low-level repo fns to include/git2/sys 2013-04-21 11:50:56 -07:00
Russell Belfer
83cc70d9fe Move odb_backend implementors stuff into git2/sys
This moves some of the odb_backend stuff that is related to the
internals of an odb_backend implementation into include/git2/sys.

Some of the stuff related to streaming I left in include/git2
because it seemed like it would be reasonably needed by a normal
user who wanted to stream objects into and out of the ODB.

Also, I added APIs for traversing the list of backends so that
some of the tests would not need to access ODB internals.
2013-04-21 11:50:55 -07:00
Russell Belfer
83041c711c Move git_config_backend to include/git2/sys
Moving backend implementor objects into include/git2/sys so the
APIs can be isolated from the ones that normal libgit2 users
would be likely to use.
2013-04-21 11:50:55 -07:00
Carlos Martín Nieto
1be680c4d0 refspec: unify the string and parsed data
It used to be separate as an attempt to make the querying easier, but
it didn't work out that way, so put all the data together.

Add git_refspec_string() as well to get the original string, which is
now stored alongside the independent parts.
2013-04-20 19:45:40 +02:00
Carlos Martín Nieto
bc6374eac4 remote: allow querying for refspecs
Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs
from the remote and rename the refspec-adding functions to a less
silly name.

Use this instead of the vector index hacks in the tests.
2013-04-20 19:45:40 +02:00
Carlos Martín Nieto
4330ab26b5 remote: handle multiple refspecs
A remote can have a multitude of refspecs. Up to now our git_remote's
have supported a single one for each fetch and push out of simplicity
to get something working.

Let the remotes and internal code know about multiple remotes and get
the tests passing with them.

Instead of setting a refspec, the external users can clear all and add
refspecs. This should be enough for most uses, though we're still
missing a querying function.
2013-04-20 17:54:13 +02:00
Carlos Martín Nieto
e5a27f039e config: allow setting multivars when none exist yet
Adding a multivar when there are no variables with that name set
should set the variable instead of failing.
2013-04-20 17:54:12 +02:00
Carlos Martín Nieto
8f24e65ff6 Plug a couple of leaks 2013-04-20 16:20:33 +02:00
Edward Thomson
4e4eab52f7 alloc doesn't take a refdb; git_refdb_free nicely in the tests 2013-04-19 18:43:17 -05:00
Russell Belfer
38fd8121a2 Fix win64 warnings 2013-04-18 14:59:25 -07:00
Russell Belfer
9ea29c8f1d Fix fs iterator test on case sensitive fs 2013-04-18 14:59:25 -07:00
Russell Belfer
2aee1aa416 Fix uninitialized var warnings 2013-04-18 14:59:25 -07:00
Russell Belfer
627d590819 More filesystem iterator tests
Refactors the helper function that builds a directory hierarchy
and then made use of it to try more variations on filesystem
iterator tests.
2013-04-18 14:59:25 -07:00
Russell Belfer
ff0ddfa4bb Add filesystem iterator variant
This adds a new variant iterator that is a raw filesystem iterator
for scanning directories from a root.  There is still more work to
do to blend this with the working directory iterator.
2013-04-18 14:59:24 -07:00
Vicent Martí
53cb87575d Merge pull request #1478 from ethomson/win32_typechange_test
use a longer string for dummy data in test to avoid conflicting w/ index
2013-04-17 15:27:53 -07:00
Edward Thomson
8023b83a94 use a longer string for dummy data in test to avoid conflicting w/ index 2013-04-17 17:21:17 -05:00
Vicent Marti
3be933b143 refs: Add git_referene_target_peel 2013-04-17 17:33:51 +02:00
Vicent Martí
24f61bc53a Merge pull request #1469 from libgit2/vmg/unified-revision
Unified rev-parse, with a revision object
2013-04-15 15:47:38 -07:00
Vicent Marti
cbda09d00b git_revision -> git_revspec 2013-04-15 23:40:46 +02:00
Vicent Marti
36c2dfed69 Is this crazy? 2013-04-15 23:32:40 +02:00
Carlos Martín Nieto
67ba7d2031 Allow git_remote_ls after disconnecting from the remote
Keep the data around until free, as expected by our own fetch example
2013-04-15 23:22:32 +02:00
Vicent Marti
d064c74794 Merge remote-tracking branch 'ben/unified-revparse' into development 2013-04-15 23:18:24 +02:00
Ben Straub
299a224be1 Change git_revparse to output git_object pointers
This will probably prevent many lookup/free
operations in calling code.
2013-04-15 12:00:04 -07:00
Ben Straub
2ebc3c66c2 Redeploy git_revparse_single. 2013-04-15 11:57:24 -07:00
Carlos Martín Nieto
4a3f69b5b2 refdb tests: use the right variable size
Mixing int and size_t through pointers leads to problems
in big-endian machines.
2013-04-15 20:20:14 +02:00
Carlos Martín Nieto
0efae3b22e commit: correctly detect the start of the commit message
The end of the header is signaled by to consecutive LFs and the commit
message starts immediately after. Jumping over LFs at the start of the
message is a bug and leads to creating different commits if
when rebuilding history.

This also fixes an empty commit message being returned as "\n".
2013-04-15 12:24:08 +02:00
Vicent Martí
ea8bac37b0 Merge pull request #1450 from carlosmn/branch-upstream
Branch upstream configuration
2013-04-11 06:34:59 -07:00
Carlos Martín Nieto
d59942c2ab branch: add more upstream configuration management
Add functions to set and unset the upstream configuration to
complement the getter we already have.
2013-04-11 12:27:25 +02:00
yorah
0d32f39eb8 Notify '*' pathspec correctly when diffing
I also moved all tests related to notifying in their own file.
2013-04-11 09:59:26 +02:00
Russell Belfer
ad26434b3b Tests and more fixes for submodule diffs
This adds tests for diffs with submodules in them and (perhaps
unsurprisingly) requires further fixes to be made.  Specifically,
this fixes:

- when considering if a submodule is dirty in the workdir, it was
  being treated as dirty even if only the index was dirty.
- git_diff_patch_to_str (and git_diff_patch_print) were "printing"
  the headers for files (and submodules) that were unmodified or
  had no meaningful content.
- added comment to previous fix and removed unneeded parens.
2013-04-09 14:52:32 -07:00
Ben Straub
1aa21fe3b8 Deprecate git_revparse_single and _rangelike 2013-04-09 05:07:04 +04:00
Ben Straub
8480eef7ee Implement unified git_revparse 2013-04-08 16:36:11 +04:00
Vicent Marti
812e5aea59 test: Add missing NULLs 2013-04-07 07:23:08 +02:00
Vicent Marti
d9ecaf8c6f Merge remote-tracking branch 'gnprice/revwalk' into development 2013-04-07 07:22:38 +02:00
Greg Price
af079d8bf6 revwalk: Parse revision ranges
All the hard work is already in revparse.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
b208d90022 revparse: Parse range-like syntax
Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
2932c8826a revwalk: refactor tests a bit
Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
Greg Price
06e6eab0e2 revwalk tests: better diagram of example repo
The purported command output was already inaccurate, as the refs
aren't where it shows.  In any event, the labels a reader of this
file really needs are the indices used in commit_sorting_*, to make
it possible to understand them by referring directly from those
arrays to the diagram rather than from the index arrays, to commit_ids,
to the diagram.  Add those.

Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
nulltoken
24cb87e2a6 tag: Fix parsing when no tagger nor message 2013-03-31 14:36:51 +02:00