Commit Graph

8455 Commits

Author SHA1 Message Date
Carlos Martín Nieto
354268ca48 Merge pull request #3259 from ethomson/stash_apply_argh
Stash apply: stage new files even when not updating the index
2015-06-26 17:46:35 +02:00
Carlos Martín Nieto
3c7a46978d Merge pull request #3262 from libgit2/vmg/prefix-len
Desenfuckenate prefix lookups
2015-06-26 17:45:33 +02:00
Vicent Marti
13e5e344a6 test-diff-blob: Pass proper nibble sizes 2015-06-26 16:52:26 +02:00
Vicent Marti
a2f8d1ae2b revparse: Add test to make sure this doesn't regress 2015-06-26 16:48:58 +02:00
Vicent Marti
3d9ef2dc1b Revert "object: correct the expected ID size in prefix lookup"
This reverts commit 969d4b703c.

This was a fluke from Coverity. The length to all the APIs in the
library is supposed to be passed in as nibbles, not bytes. Passing it as
bytes would prevent us from parsing uneven-sized SHA1 strings.

Also, the rest of the library was still using nibbles (including
revparse and the odb_prefix APIs), so this change was seriously breaking
things in unexpected ways. ^^
2015-06-26 16:45:42 +02:00
Carlos Martín Nieto
14888070b9 Merge pull request #3261 from libgit2/cmn/link-one-level
pc: Put libcurl and libssh2 in Libs.private
2015-06-26 16:05:05 +02:00
Carlos Martín Nieto
790cabf06a pc: Put libcurl and libssh2 in Libs.private
Pass on to whoever wants to link to libgit2 statically the flags that we
would have used for these libraries.

Putting them in Requires.private as we do now makes pkg-config put their
dependencies in the linker arguments as well, which is not what we want.
2015-06-26 13:51:41 +02:00
Carlos Martín Nieto
341818254b Merge pull request #3234 from ethomson/dont_update_index_unnecessarily
Dont update index unnecessarily
2015-06-26 11:41:14 +02:00
Pierre-Olivier Latour
c2e1b0581a Only write index if updated when passing GIT_DIFF_UPDATE_INDEX
When diffing the index with the workdir and GIT_DIFF_UPDATE_INDEX has been passed,
the previous implementation was always writing the index to disk even if it wasn't
modified.
2015-06-26 02:00:21 -04:00
Edward Thomson
619423f238 diff: test we don't update index unnecessarily
Test that workdir diffs, when presented with UPDATE_INDEX, only
write the index when they actually make a change.
2015-06-26 02:00:20 -04:00
Edward Thomson
c0280bdd15 Merge pull request #3255 from libgit2/cmn/rename-unspecified
Rename FALLBACK to UNSPECIFIED
2015-06-25 18:55:48 -04:00
Carlos Martín Nieto
552249f941 Merge pull request #3258 from arthurschreiber/patch-6
List `libcurl` in the generated `libgit2.pc`
2015-06-26 00:49:28 +02:00
Edward Thomson
b7f5cb8dd7 stash: stage new files when unstashing them
Files that were new (staged additions) in the stash tree should
be staged when unstashing, even when not applying the index.
2015-06-25 18:34:38 -04:00
Edward Thomson
8960dc1ec6 iterator: provide git_iterator_walk
Provide `git_iterator_walk` to walk each iterator in lockstep,
returning each iterator's idea of the contents of the next path.
2015-06-25 18:34:37 -04:00
Edward Thomson
82b1c93d08 stash: don't allow apply with staged changes 2015-06-25 18:34:36 -04:00
Edward Thomson
1db6a0ab52 stash apply: add a newly staged file to tests 2015-06-25 18:33:56 -04:00
Arthur Schreiber
65f2d15561 List libcurl in the generated libgit2.pc 2015-06-25 21:49:48 +02:00
Edward Thomson
3b66c6a397 Merge pull request #3256 from libgit2/cmn/fetch-spec-fetchhead
remote: insert refspecs with no rhs in FETCH_HEAD
2015-06-25 15:36:53 -04:00
Edward Thomson
87987fd1e0 Merge pull request #3246 from libgit2/cmn/dont-grow-borrowed
Don't allow growing borrowed buffers
2015-06-25 15:26:43 -04:00
Carlos Martín Nieto
23aa7c9037 remote: insert refspecs with no rhs in FETCH_HEAD
When a refspec contains no rhs and thus won't cause an explicit update,
we skip all the logic, but that means that we don't update FETCH_HEAD
with it, which is what the implicit rhs is.

Add another bit of logic which puts those remote heads in the list of
updates so we put them into FETCH_HEAD.
2015-06-25 13:40:38 +02:00
Carlos Martín Nieto
c2418f4613 Rename FALLBACK to UNSPECIFIED
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
2015-06-25 12:48:44 +02:00
Carlos Martín Nieto
3cf91d98e2 Add CHANGELOG entries 2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
a65992355d buffer: make use of EINVALID for growing a borrowed buffer
This explains more closely what happens. While here, set an error
message.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
189aad45af errors: introduce EINVALID
We've been using EINVALIDSPEC for a while to mean this, but that name
is too specific. Introduce this to be more explicit.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
bd470d0034 blob: don't recomment using git_buf_grow
We currently recommend using `git_buf_grow` in order to make a buffer
make an owned copy of the memory it points to. This is not behaviour we
should encourage, so remove this recommendation.

The function itself is not changed, as we need to remain compatible, but
it will be changed not to allow usage on borrowed buffers.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
caab22c0d4 buffer: don't allow growing borrowed buffers
When we don't own a buffer (asize=0) we currently allow the usage of
grow to copy the memory into a buffer we do own. This muddles the
meaning of grow, and lets us be a bit cavalier with ownership semantics.

Don't allow this any more. Usage of grow should be restricted to buffers
which we know own their own memory. If unsure, we must not attempt to
modify it.
2015-06-24 23:49:10 +02:00
Carlos Martín Nieto
daacf96d10 Merge pull request #3097 from libgit2/cmn/submodule-config-state
Remove run-time configuration settings from submodules
2015-06-24 23:34:40 +02:00
Carlos Martín Nieto
e1f434f864 Merge pull request #3183 from libgit2/cmn/curl-stream
Implement a cURL stream
2015-06-24 23:33:46 +02:00
Carlos Martín Nieto
9d5efab89f Merge pull request #3254 from ethomson/diff-binary-patch
Handle binary DIFFABLEness properly
2015-06-24 21:13:23 +02:00
Carlos Martín Nieto
c2f274c69e Merge pull request #3250 from ethomson/stash
Stash workdir correctly when added in the index, modified in the workdir
2015-06-24 19:47:34 +02:00
Edward Thomson
54077091c8 diff: determine DIFFABLE-ness for binaries
Always set `GIT_DIFF_PATCH_DIFFABLE` for all files, regardless of
binary-ness, so that the binary callback is invoked to either
show the binary contents, or just print the standard "Binary files
differ" message.  We may need to do deeper inspection for binary
files where we have avoided loading the contents into a file map.
2015-06-24 12:06:41 -04:00
Edward Thomson
ba8fb7c46a diff::binary tests: empty diff when forced binary
Ensure that even when we're forcing a binary diff that we do not
assume that there *is* a diff.  There should be an empty diff for
no change.
2015-06-24 11:39:59 -04:00
Carlos Martín Nieto
58ca8c7e1f SecureTransport: use the curl stream if available
If the libcurl stream is available, use that as the underlying stream
instead of the socket stream. This allows us to set a proxy for HTTPS
connections.
2015-06-24 17:27:16 +02:00
Carlos Martín Nieto
8443f492dd curl: remove the encrypted param to the constructor
We do not want libcurl to perform the TLS negotiation for us, so we
don't need to pass this option.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
f97d5d090c http: ask for the curl stream for non-encrypted connections
The TLS streams talk over the curl stream themselves, so we don't need
to ask for it explicitly. Do so in the case of the non-encrypted one so
we can still make use proxies in that case.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
e247649dfa openssl: use the curl stream if available
When linking against libcurl, use it as the underlying transport instead
of straight sockets. We can't quite just give over the file descriptor,
as curl puts it into non-blocking mode, so we build a custom BIO so
OpenSSL sends the data through our stream, be it the socket or curl
streams.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
cdee630f6f curl: extract certificate information
The information is exposed by curl for some crypto libraries in the form
of name:content strings. We can't do much more than return this
information.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
8762d721f4 http: set the proxy if the stream supports it
Of the built-in ones, only cURL support it, but there's no reason a
user-provided stream wouldn't support it.
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
1376e784c6 stream: add support for setting a proxy
If the stream claims to support this feature, we can let the transport
set the proxy.

We also set HTTPPROXYTUNNEL option so curl can create a tunnel through
the proxy which lets us create our own TLS session (if needed).
2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
ede517bc53 curl: add CHANGELOG and THREADING entries 2015-06-24 17:26:36 +02:00
Carlos Martín Nieto
8dea1c21f5 Implement a curl stream
cURL has a mode in which it acts a lot like our streams, providing send
and recv functions and taking care of the TLS and proxy setup for us.

Implement a new stream which uses libcurl instead of raw sockets or the
TLS libraries directly. This version does not support reporting
certificates or proxies yet.
2015-06-24 17:25:05 +02:00
Carlos Martín Nieto
cf9d5f7602 curl: find and link with the library if it's available by default 2015-06-24 17:25:05 +02:00
Carlos Martín Nieto
76633215d1 binary diff: test that the diff and patch otputs are the same
We test the generation of the textual patch via the patch function,
which are just one of two possibilities to get the output.

Add a second patch generation via the diff function to make sure both
outputs are in sync.
2015-06-24 14:33:02 +02:00
Edward Thomson
aacfd03dba Merge pull request #3251 from git-up/fixes
Fixes
2015-06-24 00:30:19 -04:00
Pierre-Olivier Latour
6a8f3fa850 Fixed invalid error handling in git_repository_open_ext() 2015-06-23 20:59:03 -07:00
Pierre-Olivier Latour
8113056c7a Fixed Xcode 6.1 build warnings 2015-06-23 20:57:09 -07:00
Edward Thomson
cc605e73ac Merge pull request #3222 from git-up/conflicted
Fixed GIT_DELTA_CONFLICTED not returned in some cases
2015-06-23 23:52:03 -04:00
Edward Thomson
09f3364d7a Merge pull request #3131 from urkud/const-char
Add `const` qualifier
2015-06-23 23:40:02 -04:00
Edward Thomson
bd670abd23 Merge pull request #3226 from libgit2/cmn/racy-diff-again
racy-git, the missing link
2015-06-23 23:30:58 -04:00
Edward Thomson
8351abc782 Merge pull request #3249 from libgit2/cmn/repo-version-check
Check the repository version
2015-06-23 23:17:18 -04:00