Commit Graph

5290 Commits

Author SHA1 Message Date
Fraser Tweedale
e52963080a netops: remove duplicate include
9e9aee6 added an include <netinet/in.h> to fix the build on FreeBSD.
Sometime since then the same header is included ifndef _WIN32, so
remove the duplicate include.
2013-08-24 20:15:22 +10:00
Vicent Martí
6910ecb036 Merge pull request #1807 from frasertweedale/fix/freebsd
fix tests on FreeBSD
2013-08-24 02:43:38 -07: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
6890e00c0e Merge pull request #1801 from ethomson/utf8_bom
Skip UTF-8 BOM in binary detection
2013-08-21 16:57:45 -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
Russell Belfer
5e1fb2828a Merge pull request #1800 from ethomson/mingw_warnings
Quiet down some warnings
2013-08-19 16:01:30 -07:00
Edward Thomson
8255b497b6 Quiet down some warnings 2013-08-19 17:49:53 -05:00
Ben Straub
adf9628262 Merge pull request #1796 from ethomson/fix_inet_pton
Fix p_inet_pton on windows
2013-08-19 15:47:31 -07: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
Ben Straub
25b2a55538 Merge pull request #1799 from ethomson/gettimeofday
Use time(2) to get the time
2013-08-19 15:06:39 -07:00
Edward Thomson
86967cc579 Use time(2) to get the time
We didn't use the added precision in gettimeofday, so remove it.
This prevents us from having an unnecessary reimplementation on
win32.
2013-08-19 16:44:17 -05:00
Ben Straub
eb04744621 Merge pull request #1797 from ethomson/keep_hash_ctx_private
Don't expose git_hash_ctx since it's internal
2013-08-19 11:00:20 -07:00
Carlos Martín Nieto
5875e8d21a travis: exit on failure for anything related to building 2013-08-19 18:50:03 +02:00
Edward Thomson
67c177ef26 Don't expose git_hash_ctx since it's internal
And doing so makes the mingw build choke.
2013-08-19 11:42:50 -05:00
Carlos Martín Nieto
6d69fbce31 Revparse does not handle refspecs 2013-08-19 13:04:05 +02: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
Vicent Martí
1c1b4e8a15 Merge pull request #1792 from libgit2/ntk/bug/prefix_size
odb: Straighten oid prefix handling
2013-08-19 02:16:02 -07:00
Vicent Martí
9abf7ea797 Merge pull request #1794 from libgit2/cmn/elocked
index: report when it's locked
2013-08-19 02:06:15 -07:00
Carlos Martín Nieto
6818080871 travis: really fail if the tests fail
When implementing the ssh testing, the move to the script made it so
the first test suite's exit code was ignored. Check whether the main
tests fail and exit with an error in that case.
2013-08-19 10:50:28 +02: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
Ben Straub
8f81ea45ca Merge pull request #1793 from libgit2/ntk/valgrind
Bring Valgrind back!
2013-08-18 18:30:48 -07:00
nulltoken
90a8ad63e3 ci: Make Valgrind run on Travis 2013-08-19 00:18:44 +02:00
nulltoken
d19dd9cf73 odb: Straighten oid prefix handling 2013-08-18 23:38:51 +02:00
Carlos Martín Nieto
090a07d295 odb: avoid hashing twice in and edge case
If none of the backends support direct writes and we must stream the
whole file, we already know what the object's id should be; so use the
stream's functions directly, bypassing the frontend's hashing and
overwriting of our existing id.
2013-08-17 02:12:04 +02:00
Carlos Martín Nieto
7a3764bee9 odb: document git_odb_stream
Clarify the role of each function and in particular mention that there
is no need for the backend or stream to worry about the object's id,
as it will be given when `finalize_write` is called.
2013-08-17 02:02:28 +02:00
Carlos Martín Nieto
fe0c6d4e71 odb: make it clearer that the id is calculated in the frontend
The frontend is in charge of calculating the id of the objects. Thus
the backends should treat it as a read-only value. The positioning in
the function signature made it seem as though it was an output
parameter.

Make the id const and move it from the front to behind the subject
(backend or stream).
2013-08-17 01:41:08 +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
Vicent Martí
b2be62fd23 Merge pull request #1790 from libgit2/examples-init
Add "git init"-like example
2013-08-16 15:33:13 -07:00
Russell Belfer
0ea41445f4 Improve isolation of new test from user environs 2013-08-16 15:04:15 -07:00
Russell Belfer
944c1589c2 Add example like "git init" 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
Russell Belfer
ce23330fd6 Add new git_signature_default API using config
This adds a new API for creating a signature that uses the
config to look up "user.name" and "user.email".
2013-08-16 15:04:15 -07:00
Ben Straub
68458e422a Merge pull request #1789 from martinwoodward/posix_win32-attribution
Give credit to PHP for the p_readlink function in posix_w32.c
2013-08-16 13:25:18 -07:00
Martin Woodward
c9340df055 Give credit to PHP for the p_readlink function in posix_w32.c 2013-08-16 19:40:58 +01:00
Carlos Martín Nieto
5ce6c1e917 push: handle tag chains correctly
When dealing with a chain of tags, we need to enqueue each of them
individually, which means we can't use `git_tag_peel` as that jumps
over the intermediate tags.

Do the peeling manually so we can look at each object and take the
appropriate action.
2013-08-16 01:32:29 +02:00
Carlos Martín Nieto
d4e6cf0cd0 odb: remove a duplicate object header formatting function 2013-08-15 14:32:47 +02:00
Carlos Martín Nieto
8380b39a67 odb: perform the stream hashing in the frontend
Hash the data as it's coming into the stream and tell the backend what
its name is when finalizing the write. This makes it consistent with
the way a plain git_odb_write() performs the write.
2013-08-15 14:29:39 +02: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í
4424622328 Merge pull request #1784 from evhan/development
revparse: Free left side of invalid range revspecs
2013-08-14 23:15:02 -07:00
Evan Hanson
1616fa68e5 revparse: Use more idiomatic error value test 2013-08-15 17:25:05 +12:00
Evan Hanson
899ec41fa1 revparse: Free left side of invalid range revspecs
This fixes a small memory leak in git_revparse where early returns on
errors from git_revparse_single cause a free() on the (reallocated) left
side of the revspec to be skipped.
2013-08-15 16:25:48 +12:00
Vicent Marti
1e94df08da sha1-lookup: This assert was correct 2013-08-15 00:09:46 +02:00
Russell Belfer
c87bf86cd7 Commit 7affc2f7 removed var initialization
That commit accidentally removed the initialization of the "start"
variable giving undefined results for the host extraction from the
url input.
2013-08-14 10:58:02 -07:00
Vicent Martí
ad0af71575 Merge pull request #1780 from phkelley/development
Respect GIT_SSL_NO_VERIFY and http.sslVerify
2013-08-14 06:48:09 -07: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
Vicent Martí
c4ded21e83 Merge pull request #1774 from libgit2/test-ssh
Test SSH in travis
2013-08-14 06:43:43 -07:00
Vicent Martí
89f6d84ccf Merge pull request #1781 from brodie/brodie/stat-before-open
fileops: stat() before open()ing in git_futils_readbuffer_updated()
2013-08-14 06:40:38 -07:00
Vicent Martí
d5904eb865 Merge pull request #1782 from libgit2/vmg/no-lookup
Do not use the "experimental" lookup mode
2013-08-14 06:38:37 -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