Commit Graph

1403 Commits

Author SHA1 Message Date
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
Edward Thomson
c0b01b7572 Skip UTF-8 BOM in binary detection
When a git_buf contains a UTF-8 BOM, the three bytes comprising
that BOM are treated as unprintable characters.  For a small git_buf,
the three BOM characters overwhelm the printable characters.  This
is problematic when trying to check out a small file as the CR/LF
filtering will not apply.
2013-08-19 18:46:26 -05:00
Edward Thomson
238b761491 Fix p_inet_pton on windows
p_inet_pton on Windows should set errno properly for callers.
Rewrite p_inet_pton to handle error cases correctly and add
test cases to exercise this function.
2013-08-19 17:21:35 -05:00
Vicent Martí
520287f63a Merge pull request #1785 from libgit2/cmn/odb-hash-frontend
odb: move hashing to the frontend for streaming
2013-08-19 02:17:00 -07:00
Carlos Martín Nieto
3d27687475 index: report when it's locked
Report the index being locked with its own error code in order to be
able to differentiate, as a locked index is typically the result of a
crashed process or concurrent access, both of which often require user
intervention to fix.
2013-08-19 10:30:44 +02:00
Vicent Martí
51a5e13347 Merge pull request #1778 from libgit2/push_tag_to_tag_test
push: handle tag chains correctly
2013-08-16 16:22:37 -07:00
Russell Belfer
0ea41445f4 Improve isolation of new test from user environs 2013-08-16 15:04:15 -07:00
Russell Belfer
579d87c5d3 New test that inits repo and make commit 2013-08-16 15:04:15 -07:00
Carlos Martín Nieto
376e6c9f96 odb: wrap the stream reading and writing functions
This is in preparation for moving the hashing to the frontend, which
requires us to handle the incoming data before passing it to the
backend's stream.
2013-08-15 14:29:27 +02:00
Vicent Martí
9d1751bf6e Merge pull request #1783 from libgit2/cmn/relax-remote
remote: relax the url rules
2013-08-14 06:44:28 -07:00
Carlos Martín Nieto
0b9ebb54ff remote: relax the url rules
Accept any value for the remote's url, including an empty string which
we used to reject as invalid configuration.

This is not quite what git does (although it has its own problems with
such configurations) and it makes it harder to fix the issue, by not
letting the user modify it.

As we already need to check for a valid URL when we try to connect to
the network, let that perform the check, as we don't need to do it
anywhere else.
2013-08-14 11:52:49 +02:00
Carlos Martín Nieto
5be622fb56 Test SSH in travis
Set up the ssh credentials so we are able to talk to localhost and
issue git commands. Move to use a script, as the command list is
getting somewhat long.

While here, delay installing valgrind until we need it, as it and its
dependencies are by far the largest downloads and this allows us to
start compiling (and failing) faster and we only incur this cost when
the test suite runs successfully.
2013-08-14 10:49:10 +02:00