Commit Graph

5396 Commits

Author SHA1 Message Date
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
Vicent Marti
59547ce772 oid: Helper for old-school hashcmp 2013-08-14 10:34:07 +02:00
Vicent Marti
e2164da5eb sha1_lookup: Hello my name is MSVC and how do I pointer 2013-08-14 10:31:02 +02:00
Vicent Marti
67591c8cd8 sha1_lookup: do not use the "experimental" lookup mode 2013-08-14 10:28:01 +02:00
Carlos Martín Nieto
f4be8209af config: don't special-case the multivar iterator
Build it on top of the normal iterator instead, which lets use re-use
a lot of code.
2013-08-14 00:45:05 +02:00
Philip Kelley
af6dab7ef7 Respect GIT_SSL_NO_VERIFY and http.sslVerify 2013-08-13 15:10:03 -04:00
Ben Straub
2af9bcb2db Merge pull request #1779 from ben/win32-precompiled-header-speedup
Speed up build under MSVC
2013-08-13 11:37:31 -07:00
Vicent Martí
40948998ba Merge pull request #1767 from libgit2/win32-bigger-utf8-buffer
Bigger buffer for utf-8 parsing in win32
2013-08-13 11:36:24 -07:00
Brodie Rao
9ccdb21155 fileops: stat() before open()ing in git_futils_readbuffer_updated()
This reverts refactoring done in 13224ea4aa
that introduces a performance regression for NFS when reading files that
don't exist. open() forces a cache invalidation on NFS, while stat()ing a
file just uses the cache and is very quick.

To give a specific example, say you have a repo with a thousand packed
refs. Before this change, looking up every single one ould incur a thousand
slow open() calls. With this change, it's a thousand fast stat() calls.
2013-08-13 10:55:37 -07:00
Russell Belfer
0228a51429 Missed one path for path_as_utf8 type 2013-08-13 10:20:25 -07:00
Russell Belfer
ee0656012c Minor win32 fixes and improvements
This is just a bunch of small fixes that I noticed while looking
at the UTF8 and UTF16 path stuff.  It fixes a slowdown in looking
for an empty directory (not exiting loop asap), makes the dir name
in the git__DIR structure be a GIT_FLEX_ARRAY to save an allocation,
and fixes some slightly odd assumptions in the cl_getenv helper.
2013-08-13 09:53:56 -07:00
Russell Belfer
841034a35e Reintroduce type for UTF8 win32 path conversions 2013-08-13 09:45:56 -07:00
Russell Belfer
d4cff0cb1c Rename git__win32_path fns to git_win32_path 2013-08-13 09:40:32 -07:00
Ben Straub
e12618b1ec Add some things to precompiled header 2013-08-13 09:22:53 -07:00