Commit Graph

1414 Commits

Author SHA1 Message Date
Russell Belfer
e580afd863 Add tests for git_tree_walk
This tests the fixes for issues from #1849
2013-09-13 14:33:26 -07:00
nulltoken
6f2003612c clar: Move cl_assert_equal_sz() definition to clar.h 2013-09-12 13:54:33 +02:00
nulltoken
273ddc54f5 clar: Fix clar__assert_equal error message formating 2013-09-12 13:54:22 +02:00
Russell Belfer
6c38e60a00 Merge pull request #1838 from libgit2/cmn/first-parent
revwalk: allow simplifying by first-parent
2013-09-10 16:55:58 -07:00
nulltoken
209f9b67c4 odb: Teach loose backend to return EAMBIGUOUS 2013-09-10 22:36:13 +02:00
Carlos Martín Nieto
15f7b9b8d9 revwalk: allow simplifying by first-parent
When enabled, only the first parent of each commit will be queued,
enabling a simple way of using first-parent simplification.
2013-09-09 20:31:14 +02:00
nulltoken
031f3f8028 odb: Error when streaming in too [few|many] bytes 2013-09-07 23:00:20 +02:00
Vicent Martí
ef6389ad50 Merge pull request #1836 from libgit2/ntk/fix/leaks
Fix memory leaks
2013-09-07 09:18:56 -07:00
nulltoken
e839efbe24 tests: Fix memory leaks 2013-09-07 17:51:24 +02:00
nulltoken
a8d67afe42 revparse: Prevent unnecessary odb backend calls 2013-09-07 17:48:05 +02:00
nulltoken
4047950f30 odb: Prevent stream_finalize_write() from overwriting
Now that #1785 is merged, git_odb_stream_finalize_write() calculates the object id before invoking the odb backend.

This commit gives a chance to the backend to check if it already knows this object.
2013-09-06 22:47:28 +02:00
nulltoken
ae4a486605 blob: Slightly enforce a create_fromchunks() test 2013-09-06 22:21:37 +02:00
Russell Belfer
a7fcc44dcf Better macro name for is-exec-bit-set test 2013-09-05 16:14:32 -07:00
Russell Belfer
af22dabb43 GIT_MODE_TYPE should exclude setgid bits
The GIT_MODE_TYPE macro was looking at all bits above the
permissions, but it should really just look at the top bits so
that it will give the right results for a setgid or setuid entry.

Since we're now using these macros in the tests, this was causing
a test failure on platforms that don't support setgid.
2013-09-05 12:01:17 -07:00
Russell Belfer
c97d407d9c Fix tests of file modes
This fixes an issue checking file modes in the tests that
initialize a repo from a template directory when a symlink is
used in the template.  Also, this updates some other places where
we are examining file modes to use the new macros.
2013-09-05 11:45:29 -07:00
Russell Belfer
27061b151a Fix some newer GCC compiler warnings 2013-09-05 10:25:16 -07:00
Russell Belfer
9ce4f7da4a Fix tests to use core.filemode correctly
Some windows tests were failing
2013-09-04 16:41:34 -07:00
Russell Belfer
2a54c7f447 _umask is function name on Windows 2013-09-04 16:24:36 -07:00
Russell Belfer
abfed59c27 Clean up one other mode_t assertion 2013-09-04 16:23:00 -07:00
Russell Belfer
780f3e540f Make tests take umask into account
It seems that libgit2 is correctly applying the umask when
initializing a repository from a template and when creating new
directories during checkout, but the test suite is not accounting
for possible variations due to the umask.  This updates that so
that the test suite will work regardless of the umask.
2013-09-04 16:23:00 -07:00
Russell Belfer
cf94024c58 Update clar 2013-09-04 16:23:00 -07:00
Ben Straub
61d57b7a21 Test pushing to remotes with "file:///" urls 2013-09-04 14:27:59 -07:00
Vicent Martí
e98535923b Merge pull request #1817 from libgit2/ntk/fix/backend/honor_refresh_capabilities
Of backends and refreshers...
2013-09-04 06:20:36 -07:00
Russell Belfer
cae5293854 Fix resolving relative windows network paths 2013-09-03 14:00:27 -07:00
Russell Belfer
0d1af399e9 don't use inline in tests for win32 2013-09-03 12:33:34 -07:00
Vicent Martí
6208bd499b Merge pull request #1804 from ethomson/rewrites
Minor changes for rewrites
2013-09-03 12:29:18 -07:00
Nikolai Vladimirov
6d9a6c5cec path: properly resolve relative paths 2013-09-03 20:45:53 +03:00
Krzysztof Adamski
3b75b684a1 Define S_IREAD i S_IWRITE for Android. 2013-09-01 18:53:07 +02:00
nulltoken
a12e069a3e odb: Honor the non refreshing capability of a backend 2013-08-30 23:19:02 +02:00
Carlos Martín Nieto
0001c02316 Fix typo _delete -> _free 2013-08-29 13:22:44 +02:00
Vicent Martí
dbecec37a7 Merge pull request #1805 from libgit2/threading-packed-load
Thread safety for the refdb_fs
2013-08-28 09:38:14 -07:00
Edward Thomson
17c7fbf6d2 Split rewrites, status doesn't return rewrites
Ensure that we apply splits to rewrites, even if we're not
interested in examining it closely for rename/copy detection.

In keeping with core git, status should not display rewrites,
it should simply show files as "modified".
2013-08-28 08:30:19 -05:00
Vicent Martí
1ef05e3f0e Merge pull request #1803 from libgit2/ntk/topic/even_more_lenient_remote_parsing
Even more lenient remote parsing
2013-08-28 06:05:50 -07:00
Vicent Martí
b8b22d774e Merge pull request #1772 from libgit2/config-iter
Configuration iterators redux
2013-08-28 06:04:51 -07:00
Edward Thomson
1ff3a09415 Improve win32 version check, no ipv6 tests on XP 2013-08-27 19:44:35 -05:00
nulltoken
aec87f712f remote: Make git_remote_list() detect pushurl 2013-08-27 20:14:10 +02:00
nulltoken
191adce875 vector: Teach git_vector_uniq() to free while deduplicating 2013-08-27 20:14:07 +02:00
nulltoken
c9ffa84bde remote: Relax the parsing logic even more
In order to be loaded, a remote needs to be configured with at least a `url` or a `pushurl`.

ENOTFOUND will be returned when trying to git_remote_load() a remote with neither of these entries defined.
2013-08-27 19:31:19 +02:00
nulltoken
ece24ef7c4 remote: Don't parse missing urls as empty strings 2013-08-27 16:57:17 +02:00
Nikolai Vladimirov
504850cdf5 refs: add git_reference_is_tag 2013-08-26 08:04:10 +03:00
Fraser Tweedale
9d85f00722 fix tests on FreeBSD
238b761 introduced a test for posix behaviour, but on FreeBSD some
of the structs and constants used aren't defined in <arpa/inet.h>.
Include the appropriate headers to get the tests working again on
FreeBSD.
2013-08-24 17:39:15 +10:00
Russell Belfer
44d6553186 Fix comment 2013-08-23 12:03:44 -07:00
Russell Belfer
b6ac07b517 Trying to fix Win32 warnings 2013-08-22 14:45:10 -07:00
Russell Belfer
972bb689c4 Add SRWLock implementation of rwlocks for Win32 2013-08-22 14:10:56 -07:00
Russell Belfer
8d9a85d43a Convert sortedcache to use rwlock
This is the first use we have of pthread_rwlock_t in libgit2.
Hopefully it won't cause any serious portability problems.
2013-08-22 11:40:53 -07:00
Russell Belfer
b37359aac5 Fix warnings when compiling without threads 2013-08-21 16:50:03 -07:00
Russell Belfer
fe37274080 Rewrite refdb_fs using git_sortedcache object
This adds thread safety to the refdb_fs by using the new
git_sortedcache object and also by relaxing the handling of some
filesystem errors where the fs may be changed out from under us.

This also adds some new threading tests that hammer on the refdb.
2013-08-21 16:26:32 -07:00
Russell Belfer
a4977169e1 Add sortedcache APIs to lookup index and remove
This adds two other APIs that I need to the sortedcache type.
2013-08-21 14:09:38 -07:00
Russell Belfer
0b7cdc0263 Add sorted cache data type
This adds a convenient new data type for caching the contents of
file in memory when each item in that file corresponds to a name
and you need to both be able to lookup items by name and iterate
over them in some sorted order.  The new data type has locks in
place to manage usage in a threaded environment.
2013-08-20 16:14:24 -07:00
Russell Belfer
0f0f565507 Don't try to pack symbolic refs
If there were symbolic refs among the loose refs then the code
to create packed-refs would fail trying to parse the OID out of
them (where Git just skips trying to pack them).  This fixes it.
2013-08-20 16:14:23 -07:00