Commit Graph

4865 Commits

Author SHA1 Message Date
Russell Belfer
24c70804e8 Add mutex around mapping and unmapping pack files
When I was writing threading tests for the new cache, the main
error I kept running into was a pack file having it's content
unmapped underneath the running thread.  This adds a lock around
the routines that map and unmap the pack data so that threads can
effectively reload the data when they need it.

This also required reworking the error handling paths in a couple
places in the code which I tried to make consistent.
2013-04-22 16:50:51 +02:00
Russell Belfer
b12b72ea82 Add range checking around cache opts
Add a git_cache_set_max_object_size method that does more checking
around setting the max object size.  Also add a git_cache_size to
read the number of objects currently in the cache.  This makes it
easier to write tests.
2013-04-22 16:50:51 +02:00
Russell Belfer
badd85a613 Use git_odb_object_data/_size whereever possible
This uses the odb object accessors so we can change the internals
more easily...
2013-04-22 16:50:51 +02:00
Vicent Marti
ee12272d17 Global option setters 2013-04-22 16:50:51 +02:00
Vicent Marti
e183e375b8 Clear the cache when there are too many items to expire 2013-04-22 16:50:51 +02:00
Vicent Marti
e16e268457 No longer needed 2013-04-22 16:50:51 +02:00
Vicent Marti
d9d423e421 Some stats 2013-04-22 16:50:51 +02:00
Vicent Marti
064236ca45 Per-object max size 2013-04-22 16:50:51 +02:00
Vicent Marti
cf7850a4f7 Duplicated type object 2013-04-22 16:50:50 +02:00
Vicent Marti
8842c75f17 What has science done. 2013-04-22 16:50:50 +02:00
Vicent Marti
c4e91d4500 Random eviction 2013-04-22 16:50:50 +02:00
Vicent Marti
6b90e244de Per-object filtering 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í
a92dd31607 Merge pull request #1489 from libgit2/vmg/dupe-odb-backends
Do not allow duplicate ODB backends
2013-04-22 07:44:52 -07:00
Vicent Martí
a472f887fe Merge pull request #1493 from carlosmn/remotes
Revamp the refspec handling
2013-04-22 07:44:32 -07:00
Vicent Marti
0edad3cc04 Merge branch 'development' into vmg/dupe-odb-backends
Conflicts:
	src/odb.c
2013-04-22 16:41:56 +02:00
Vicent Marti
4ef2c79cb6 odb: Disable inode checks for Win32 2013-04-22 16:37:40 +02:00
Vicent Martí
f063a75882 Merge pull request #1485 from libgit2/include-git2-sys
Create include/git2/sys and move backend APIs there
2013-04-22 04:06:11 -07:00
Vicent Martí
bfb4facb3a Merge pull request #1495 from jasperla/development
Add missing prototype for p_realpath().
2013-04-21 15:20:36 -07:00
Jasper Lievisse Adriaanse
0d4a5b13af Add missing prototype for p_realpath(). 2013-04-22 00:13:35 +02: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
9233b3de4e Move git_commit_create_from_oids into sys/commit.h
Actually this renames git_commit_create_oid to
git_commit_create_from_oids and moves the API declaration to
include/git2/sys/commit.h since it is a dangerous API for general
use (because it doesn't check that the OID list items actually
refer to real objects).
2013-04-21 11:50:56 -07:00
John Wiegley
9255039898 Added git_commit_create_oid 2013-04-21 11:50:56 -07:00
Russell Belfer
1384b688d0 Move some low-level repo fns to include/git2/sys 2013-04-21 11:50:56 -07:00
John Wiegley
7cc3c92027 Added git_repository_new function 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
Vicent Martí
3a2a511be3 Merge pull request #1494 from nulltoken/fix/mailmap
mailmap: Coalesce some identities
2013-04-21 05:48:08 -07:00
nulltoken
6b24688758 mailmap: Coalesce some identities 2013-04-21 09:04:01 +02: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
Vicent Martí
cf97799ed3 Merge pull request #1491 from ethomson/backends_dont_refdb
alloc doesn't take a refdb
2013-04-20 01:50:43 -07: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
Carlos Martín Nieto
4a38143c93 remote: specify what values direction can mean in git_remote_connect()
This fixes #1487
2013-04-19 23:55:37 +02:00
Vicent Marti
a29c6b5f47 odb: Do not allow duplicate on-disk backends 2013-04-19 23:51:18 +02:00
Russell Belfer
9d8f97c9bc Merge pull request #1479 from arrbee/iterator-for-directory
Add filesystem iterator variant
2013-04-19 11:18:34 -07:00
Ben Straub
743048f1e9 Fix some minor issues 2013-04-19 10:29:50 -07:00
Russell Belfer
1af80a6766 Fix workdir iterator leak
When attempting to create a workdir iterator for a bare repo,
don't leak the iterator structure.
2013-04-18 16:13:52 -07: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
fc57471a0c More filesystem iterator cleanup
Renamed the callback functions and made some minor rearrangements
to clean up the flow of some code.
2013-04-18 14:59:25 -07:00
Russell Belfer
71f85226eb Make workdir iterator use filesystem iterator
This adds some hooks into the filesystem iterator so that the
workdir iterator can just become a wrapper around it.  Then we
remove most of the workdir iterator code and just have it augment
the filesystem iterator with skipping .git entries, updating the
ignore stack, and checking for submodules.
2013-04-18 14:59:24 -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í
2b63dbfbc1 Merge pull request #1482 from nviennot/error-name-email
Return error for empty name/email
2013-04-18 06:01:41 -07:00