]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years agowinhttp: remove unused var
Edward Thomson [Tue, 30 Jun 2015 14:23:41 +0000 (14:23 +0000)]
winhttp: remove unused var

9 years agoposix compat: include sys/stat.h for mingw
Edward Thomson [Tue, 30 Jun 2015 14:21:29 +0000 (14:21 +0000)]
posix compat: include sys/stat.h for mingw

9 years agodiff: use size_t format
Edward Thomson [Tue, 30 Jun 2015 14:20:31 +0000 (14:20 +0000)]
diff: use size_t format

9 years agoMerge pull request #3271 from jeffhostetler/more_leaks
Edward Thomson [Tue, 30 Jun 2015 14:29:41 +0000 (09:29 -0500)]
Merge pull request #3271 from jeffhostetler/more_leaks

memory leak refspec.c

9 years agofix memory leak in refspec.c on errors.
Jeff Hostetler [Mon, 29 Jun 2015 21:32:22 +0000 (17:32 -0400)]
fix memory leak in refspec.c on errors.

9 years agoMerge pull request #3270 from ethomson/warnings2
Carlos Martín Nieto [Tue, 30 Jun 2015 08:21:06 +0000 (10:21 +0200)]
Merge pull request #3270 from ethomson/warnings2

Remove some warnings

9 years agocheckout test: check getcwd return value
Edward Thomson [Mon, 29 Jun 2015 22:12:20 +0000 (22:12 +0000)]
checkout test: check getcwd return value

9 years agoclar: test chdir
Edward Thomson [Mon, 29 Jun 2015 22:10:45 +0000 (22:10 +0000)]
clar: test chdir

9 years agofilter test: pass base type
Edward Thomson [Mon, 29 Jun 2015 21:54:06 +0000 (21:54 +0000)]
filter test: pass base type

9 years agoexamples: clean up some warnings
Edward Thomson [Mon, 29 Jun 2015 21:48:35 +0000 (21:48 +0000)]
examples: clean up some warnings

9 years agoodb: cast to long long for printf
Edward Thomson [Mon, 29 Jun 2015 21:45:04 +0000 (21:45 +0000)]
odb: cast to long long for printf

9 years agosubmodule: cast enum to int for compare
Edward Thomson [Mon, 29 Jun 2015 21:37:07 +0000 (21:37 +0000)]
submodule: cast enum to int for compare

9 years agoopenssl: free hostname
Edward Thomson [Mon, 29 Jun 2015 20:29:29 +0000 (20:29 +0000)]
openssl: free hostname

9 years agostash: const up conflict params
Edward Thomson [Mon, 29 Jun 2015 20:21:22 +0000 (15:21 -0500)]
stash: const up conflict params

9 years agoindex test: include repository.h for decl
Edward Thomson [Mon, 29 Jun 2015 20:20:34 +0000 (15:20 -0500)]
index test: include repository.h for decl

9 years agostash: drop unused variable
Edward Thomson [Mon, 29 Jun 2015 20:17:58 +0000 (15:17 -0500)]
stash: drop unused variable

9 years agoiterator_walk: drop unused variable
Edward Thomson [Mon, 29 Jun 2015 20:16:22 +0000 (15:16 -0500)]
iterator_walk: drop unused variable

9 years agoMerge pull request #3269 from libgit2/cmn/release-fixups
Edward Thomson [Mon, 29 Jun 2015 20:22:47 +0000 (15:22 -0500)]
Merge pull request #3269 from libgit2/cmn/release-fixups

Submodule and http fixes

9 years agohttp: don't give up on auth on the first try
Carlos Martín Nieto [Mon, 29 Jun 2015 19:12:44 +0000 (21:12 +0200)]
http: don't give up on auth on the first try

When the server rejects an authentication request, ask the caller for
the credentials again, instead of giving up on the first try.

9 years agosubmodule: remove trailing slashes from submodule paths
Carlos Martín Nieto [Mon, 29 Jun 2015 19:10:47 +0000 (21:10 +0200)]
submodule: remove trailing slashes from submodule paths

We allow looking up a submodule by path, but we lost the path
normalisation during the recent changes. Bring it back.

9 years agosubmodule: remove some obsolete logic
Carlos Martín Nieto [Mon, 29 Jun 2015 18:54:17 +0000 (20:54 +0200)]
submodule: remove some obsolete logic

Remove some of the logic that was left-over from the time we had a cache
of submodules, plugging a leak of the submodule object in certain cases.

9 years agoCHANGELOG: add submodule changes
Carlos Martín Nieto [Mon, 29 Jun 2015 13:02:19 +0000 (15:02 +0200)]
CHANGELOG: add submodule changes

9 years agoMerge pull request #3268 from libgit2/vmg/pkg-config-sort
Vicent Marti [Mon, 29 Jun 2015 10:27:09 +0000 (12:27 +0200)]
Merge pull request #3268 from libgit2/vmg/pkg-config-sort

pkg-config: Sort the different sections

9 years agopkg-config: Sort the different sections
Vicent Marti [Mon, 29 Jun 2015 10:20:01 +0000 (12:20 +0200)]
pkg-config: Sort the different sections

Because of the fact that pkg-config is pants-on-head retarded and that
the Linux linker *requires* a static library to come before all its
dynamic dependencies in the link path, calling `pkg-config --libs
--static` was generating the wrong flags for linking.

Before this patch:

-Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/local/lib -lcurl -lssh2
-lrt -lgit2 -lssl -lcrypto -ldl -lz

After this patch:

-Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/local/lib -lgit2 -lcurl
-lssh2 -lrt -lssl -lcrypto -ldl -lz

By setting the "Libs" line before all other rules, we make sure that
`-lgit2` is the first library in the link path and that it gets its
symbols resolved with the libraries coming after it.

This fix (ab)uses an implementation detail in `pkg-config` (namely, that
flags are output as they are found on the file), but this detail seems
to be stable between releases and always gives a stable output.

9 years agoBump version to 0.23.0 and SOVERSION to 23
Carlos Martín Nieto [Sun, 28 Jun 2015 12:53:30 +0000 (14:53 +0200)]
Bump version to 0.23.0 and SOVERSION to 23

9 years agoMerge pull request #3267 from libgit2/cmn/libs-list
Carlos Martín Nieto [Sun, 28 Jun 2015 12:34:30 +0000 (14:34 +0200)]
Merge pull request #3267 from libgit2/cmn/libs-list

CMake: treat the ld flags as a list

9 years agoCMake: treat the ld flags as a list
Carlos Martín Nieto [Sun, 28 Jun 2015 11:57:06 +0000 (13:57 +0200)]
CMake: treat the ld flags as a list

These are treated as a list by CMake itself, which means that treating
them as a simple string can put semicolons in our ld command-line if we
have libraries which are not installed on the standard locations.

Treat the variable as a CMake list and replace it with the space-delimited
list just before writing it out to our pc file.

9 years agoMerge pull request #3265 from libgit2/leaks
Carlos Martín Nieto [Sat, 27 Jun 2015 19:26:27 +0000 (21:26 +0200)]
Merge pull request #3265 from libgit2/leaks

Plug a bunch of leaks

9 years agoMerge pull request #3260 from ethomson/apply_with_reflog_indices
Carlos Martín Nieto [Sat, 27 Jun 2015 19:15:00 +0000 (21:15 +0200)]
Merge pull request #3260 from ethomson/apply_with_reflog_indices

stash: test we apply using reflog-like indices

9 years agoMerge pull request #3264 from arthurschreiber/fast-builds
Carlos Martín Nieto [Sat, 27 Jun 2015 18:34:04 +0000 (20:34 +0200)]
Merge pull request #3264 from arthurschreiber/fast-builds

Fast builds?

9 years agoRemove dependency installation file for travis builds.
Arthur Schreiber [Sat, 27 Jun 2015 13:02:53 +0000 (15:02 +0200)]
Remove dependency installation file for travis builds.

We're installing dependencies via the APT addon now.

9 years agoAlways install valgrind via the apt addon.
Arthur Schreiber [Sat, 27 Jun 2015 12:54:19 +0000 (14:54 +0200)]
Always install valgrind via the apt addon.

9 years agoindex, iterator, fetchhead: plug leaks
Carlos Martín Nieto [Fri, 26 Jun 2015 16:59:53 +0000 (18:59 +0200)]
index, iterator, fetchhead: plug leaks

9 years agocheckout: plug a few leaks
Carlos Martín Nieto [Fri, 26 Jun 2015 16:49:39 +0000 (18:49 +0200)]
checkout: plug a few leaks

9 years agodiff: fix leaks in diff printing
Carlos Martín Nieto [Fri, 26 Jun 2015 16:31:39 +0000 (18:31 +0200)]
diff: fix leaks in diff printing

9 years agoMerge pull request #3263 from git-up/fixes
Carlos Martín Nieto [Fri, 26 Jun 2015 16:11:05 +0000 (18:11 +0200)]
Merge pull request #3263 from git-up/fixes

Fixes

9 years agoDon't try to start ssh.
Arthur Schreiber [Fri, 26 Jun 2015 16:05:17 +0000 (18:05 +0200)]
Don't try to start ssh.

9 years agoFast builds?
Arthur Schreiber [Fri, 26 Jun 2015 15:58:45 +0000 (17:58 +0200)]
Fast builds?

9 years agostash: test we apply using reflog-like indices
Edward Thomson [Thu, 25 Jun 2015 23:04:04 +0000 (19:04 -0400)]
stash: test we apply using reflog-like indices

9 years agoMerge pull request #3259 from ethomson/stash_apply_argh
Carlos Martín Nieto [Fri, 26 Jun 2015 15:46:35 +0000 (17:46 +0200)]
Merge pull request #3259 from ethomson/stash_apply_argh

Stash apply: stage new files even when not updating the index

9 years agoMerge pull request #3262 from libgit2/vmg/prefix-len
Carlos Martín Nieto [Fri, 26 Jun 2015 15:45:33 +0000 (17:45 +0200)]
Merge pull request #3262 from libgit2/vmg/prefix-len

Desenfuckenate prefix lookups

9 years agoRemoved unused variables
Pierre-Olivier Latour [Fri, 26 Jun 2015 15:18:06 +0000 (08:18 -0700)]
Removed unused variables

9 years agoFixed build failure if GIT_CURL is not defined
Pierre-Olivier Latour [Fri, 26 Jun 2015 15:17:56 +0000 (08:17 -0700)]
Fixed build failure if GIT_CURL is not defined

9 years agotest-diff-blob: Pass proper nibble sizes
Vicent Marti [Fri, 26 Jun 2015 14:52:26 +0000 (16:52 +0200)]
test-diff-blob: Pass proper nibble sizes

9 years agorevparse: Add test to make sure this doesn't regress
Vicent Marti [Fri, 26 Jun 2015 14:48:58 +0000 (16:48 +0200)]
revparse: Add test to make sure this doesn't regress

9 years agoRevert "object: correct the expected ID size in prefix lookup"
Vicent Marti [Fri, 26 Jun 2015 14:45:42 +0000 (16:45 +0200)]
Revert "object: correct the expected ID size in prefix lookup"

This reverts commit 969d4b703c910a8fd045baafbcd243b4c9825316.

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. ^^

9 years agoMerge pull request #3261 from libgit2/cmn/link-one-level
Carlos Martín Nieto [Fri, 26 Jun 2015 14:05:05 +0000 (16:05 +0200)]
Merge pull request #3261 from libgit2/cmn/link-one-level

pc: Put libcurl and libssh2 in Libs.private

9 years agopc: Put libcurl and libssh2 in Libs.private
Carlos Martín Nieto [Fri, 26 Jun 2015 11:51:41 +0000 (13:51 +0200)]
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.

9 years agoMerge pull request #3234 from ethomson/dont_update_index_unnecessarily
Carlos Martín Nieto [Fri, 26 Jun 2015 09:41:14 +0000 (11:41 +0200)]
Merge pull request #3234 from ethomson/dont_update_index_unnecessarily

Dont update index unnecessarily

9 years agoOnly write index if updated when passing GIT_DIFF_UPDATE_INDEX
Pierre-Olivier Latour [Sat, 6 Jun 2015 01:26:49 +0000 (18:26 -0700)]
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.

9 years agodiff: test we don't update index unnecessarily
Edward Thomson [Fri, 19 Jun 2015 18:11:12 +0000 (11:11 -0700)]
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.

9 years agoMerge pull request #3255 from libgit2/cmn/rename-unspecified
Edward Thomson [Thu, 25 Jun 2015 22:55:48 +0000 (18:55 -0400)]
Merge pull request #3255 from libgit2/cmn/rename-unspecified

Rename FALLBACK to UNSPECIFIED

9 years agoMerge pull request #3258 from arthurschreiber/patch-6
Carlos Martín Nieto [Thu, 25 Jun 2015 22:49:28 +0000 (00:49 +0200)]
Merge pull request #3258 from arthurschreiber/patch-6

List `libcurl` in the generated `libgit2.pc`

9 years agostash: stage new files when unstashing them
Edward Thomson [Sat, 20 Jun 2015 23:33:15 +0000 (19:33 -0400)]
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.

9 years agoiterator: provide git_iterator_walk
Edward Thomson [Wed, 24 Jun 2015 22:10:30 +0000 (18:10 -0400)]
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.

9 years agostash: don't allow apply with staged changes
Edward Thomson [Sat, 20 Jun 2015 20:44:22 +0000 (13:44 -0700)]
stash: don't allow apply with staged changes

9 years agostash apply: add a newly staged file to tests
Edward Thomson [Sat, 20 Jun 2015 00:29:59 +0000 (17:29 -0700)]
stash apply: add a newly staged file to tests

9 years agoList `libcurl` in the generated `libgit2.pc`
Arthur Schreiber [Thu, 25 Jun 2015 19:49:48 +0000 (21:49 +0200)]
List `libcurl` in the generated `libgit2.pc`

9 years agoMerge pull request #3256 from libgit2/cmn/fetch-spec-fetchhead
Edward Thomson [Thu, 25 Jun 2015 19:36:53 +0000 (15:36 -0400)]
Merge pull request #3256 from libgit2/cmn/fetch-spec-fetchhead

remote: insert refspecs with no rhs in FETCH_HEAD

9 years agoMerge pull request #3246 from libgit2/cmn/dont-grow-borrowed
Edward Thomson [Thu, 25 Jun 2015 19:26:43 +0000 (15:26 -0400)]
Merge pull request #3246 from libgit2/cmn/dont-grow-borrowed

Don't allow growing borrowed buffers

9 years agoremote: insert refspecs with no rhs in FETCH_HEAD
Carlos Martín Nieto [Thu, 25 Jun 2015 11:40:38 +0000 (13:40 +0200)]
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.

9 years agoRename FALLBACK to UNSPECIFIED
Carlos Martín Nieto [Thu, 25 Jun 2015 10:48:44 +0000 (12:48 +0200)]
Rename FALLBACK to UNSPECIFIED

Fallback describes the mechanism, while unspecified explains what the
user is thinking.

9 years agoAdd CHANGELOG entries
Carlos Martín Nieto [Wed, 24 Jun 2015 18:21:54 +0000 (20:21 +0200)]
Add CHANGELOG entries

9 years agobuffer: make use of EINVALID for growing a borrowed buffer
Carlos Martín Nieto [Wed, 24 Jun 2015 17:32:56 +0000 (19:32 +0200)]
buffer: make use of EINVALID for growing a borrowed buffer

This explains more closely what happens. While here, set an error
message.

9 years agoerrors: introduce EINVALID
Carlos Martín Nieto [Wed, 24 Jun 2015 17:32:07 +0000 (19:32 +0200)]
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.

9 years agoblob: don't recomment using git_buf_grow
Carlos Martín Nieto [Tue, 23 Jun 2015 13:21:12 +0000 (15:21 +0200)]
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.

9 years agobuffer: don't allow growing borrowed buffers
Carlos Martín Nieto [Tue, 23 Jun 2015 13:41:58 +0000 (15:41 +0200)]
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.

9 years agoMerge pull request #3097 from libgit2/cmn/submodule-config-state
Carlos Martín Nieto [Wed, 24 Jun 2015 21:34:40 +0000 (23:34 +0200)]
Merge pull request #3097 from libgit2/cmn/submodule-config-state

Remove run-time configuration settings from submodules

9 years agoMerge pull request #3183 from libgit2/cmn/curl-stream
Carlos Martín Nieto [Wed, 24 Jun 2015 21:33:46 +0000 (23:33 +0200)]
Merge pull request #3183 from libgit2/cmn/curl-stream

Implement a cURL stream

9 years agoMerge pull request #3254 from ethomson/diff-binary-patch
Carlos Martín Nieto [Wed, 24 Jun 2015 19:13:23 +0000 (21:13 +0200)]
Merge pull request #3254 from ethomson/diff-binary-patch

Handle binary DIFFABLEness properly

9 years agoMerge pull request #3250 from ethomson/stash
Carlos Martín Nieto [Wed, 24 Jun 2015 17:47:34 +0000 (19:47 +0200)]
Merge pull request #3250 from ethomson/stash

Stash workdir correctly when added in the index, modified in the workdir

9 years agodiff: determine DIFFABLE-ness for binaries
Edward Thomson [Wed, 24 Jun 2015 16:06:41 +0000 (12:06 -0400)]
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.

9 years agodiff::binary tests: empty diff when forced binary
Edward Thomson [Wed, 24 Jun 2015 15:39:59 +0000 (11:39 -0400)]
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.

9 years agoSecureTransport: use the curl stream if available
Carlos Martín Nieto [Wed, 24 Jun 2015 15:27:16 +0000 (17:27 +0200)]
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.

9 years agocurl: remove the encrypted param to the constructor
Carlos Martín Nieto [Thu, 11 Jun 2015 14:57:04 +0000 (16:57 +0200)]
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.

9 years agohttp: ask for the curl stream for non-encrypted connections
Carlos Martín Nieto [Thu, 11 Jun 2015 14:54:48 +0000 (16:54 +0200)]
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.

9 years agoopenssl: use the curl stream if available
Carlos Martín Nieto [Thu, 11 Jun 2015 14:50:44 +0000 (16:50 +0200)]
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.

9 years agocurl: extract certificate information
Carlos Martín Nieto [Tue, 9 Jun 2015 17:07:58 +0000 (19:07 +0200)]
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.

9 years agohttp: set the proxy if the stream supports it
Carlos Martín Nieto [Sun, 7 Jun 2015 12:51:10 +0000 (14:51 +0200)]
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.

9 years agostream: add support for setting a proxy
Carlos Martín Nieto [Sun, 7 Jun 2015 12:42:13 +0000 (14:42 +0200)]
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).

9 years agocurl: add CHANGELOG and THREADING entries
Carlos Martín Nieto [Sat, 6 Jun 2015 07:40:50 +0000 (09:40 +0200)]
curl: add CHANGELOG and THREADING entries

9 years agoImplement a curl stream
Carlos Martín Nieto [Fri, 5 Jun 2015 09:02:11 +0000 (11:02 +0200)]
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.

9 years agocurl: find and link with the library if it's available by default
Carlos Martín Nieto [Wed, 3 Jun 2015 02:57:00 +0000 (04:57 +0200)]
curl: find and link with the library if it's available by default

9 years agobinary diff: test that the diff and patch otputs are the same
Carlos Martín Nieto [Wed, 24 Jun 2015 12:25:36 +0000 (14:25 +0200)]
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.

9 years agoMerge pull request #3251 from git-up/fixes
Edward Thomson [Wed, 24 Jun 2015 04:30:19 +0000 (00:30 -0400)]
Merge pull request #3251 from git-up/fixes

Fixes

9 years agoFixed invalid error handling in git_repository_open_ext()
Pierre-Olivier Latour [Wed, 24 Jun 2015 03:59:03 +0000 (20:59 -0700)]
Fixed invalid error handling in git_repository_open_ext()

9 years agoFixed Xcode 6.1 build warnings
Pierre-Olivier Latour [Wed, 24 Jun 2015 03:57:09 +0000 (20:57 -0700)]
Fixed Xcode 6.1 build warnings

9 years agoMerge pull request #3222 from git-up/conflicted
Edward Thomson [Wed, 24 Jun 2015 03:52:03 +0000 (23:52 -0400)]
Merge pull request #3222 from git-up/conflicted

Fixed GIT_DELTA_CONFLICTED not returned in some cases

9 years agoMerge pull request #3131 from urkud/const-char
Edward Thomson [Wed, 24 Jun 2015 03:40:02 +0000 (23:40 -0400)]
Merge pull request #3131 from urkud/const-char

Add `const` qualifier

9 years agoMerge pull request #3226 from libgit2/cmn/racy-diff-again
Edward Thomson [Wed, 24 Jun 2015 03:30:58 +0000 (23:30 -0400)]
Merge pull request #3226 from libgit2/cmn/racy-diff-again

racy-git, the missing link

9 years agoMerge pull request #3249 from libgit2/cmn/repo-version-check
Edward Thomson [Wed, 24 Jun 2015 03:17:18 +0000 (23:17 -0400)]
Merge pull request #3249 from libgit2/cmn/repo-version-check

Check the repository version

9 years agostash: save the workdir file when deleted in index
Edward Thomson [Tue, 23 Jun 2015 20:27:33 +0000 (16:27 -0400)]
stash: save the workdir file when deleted in index

When stashing the workdir tree, examine the index as well.  Using
a mechanism similar to `git_diff_tree_to_workdir_with_index`
allows us to determine that a file was added in the index and
subsequently modified in the working directory.  Without examining
the index, we would erroneously believe that this file was
untracked and fail to include it in the working directory tree.

Use a slightly modified `git_diff_tree_to_workdir_with_index` in
order to avoid some of the behavior custom to `git diff`.  In
particular, be sure to include the working directory side of a
file when it was deleted in the index.

9 years agostash tests: ensure we save the workdir file
Edward Thomson [Tue, 23 Jun 2015 20:27:17 +0000 (16:27 -0400)]
stash tests: ensure we save the workdir file

Ensure that when a file is added in the index and subsequently
modified in the working directory, the stashed working directory
tree contains the actual working directory contents.

9 years agogit_diff__merge: allow pluggable diff merges
Edward Thomson [Tue, 23 Jun 2015 14:29:59 +0000 (10:29 -0400)]
git_diff__merge: allow pluggable diff merges

9 years agodiff_tform: remove reversed copy of delta merger
Edward Thomson [Mon, 22 Jun 2015 22:43:13 +0000 (18:43 -0400)]
diff_tform: remove reversed copy of delta merger

Drop `git_diff__merge_like_cgit_reversed`, since it's a copy and
paste mess of slightly incompatible changes.

9 years agorepository: check the format version
Carlos Martín Nieto [Tue, 23 Jun 2015 18:44:27 +0000 (20:44 +0200)]
repository: check the format version

This is something we do on re-init but not when opening a
repository. This hasn't particularly mattered up to now as the version
has been 0 ever since the first release of git, but the times, they're
a-changing and we will soon see version 1 in the wild. We need to make
sure we don't open those.

9 years agorepository: don't error out if there is no version
Carlos Martín Nieto [Tue, 23 Jun 2015 18:43:49 +0000 (20:43 +0200)]
repository: don't error out if there is no version

git will assume the repository format version is 0 if the value is not
there. Do the same.

9 years agoFixed GIT_DELTA_CONFLICTED not returned in some cases
Pierre-Olivier Latour [Mon, 15 Jun 2015 18:14:40 +0000 (11:14 -0700)]
Fixed GIT_DELTA_CONFLICTED not returned in some cases

If an index entry for a file that is not in HEAD is in conflicted state,
when diffing HEAD with the index, the status field of the corresponding git_diff_delta was incorrectly reported as GIT_DELTA_ADDED instead of GIT_DELTA_CONFLICTED.

This was due to handle_unmatched_new_item() initially setting the status
to GIT_DELTA_CONFLICTED but then overriding it later with GIT_DELTA_ADDED.

9 years agoMerge pull request #3228 from git-up/diff_merge
Carlos Martín Nieto [Tue, 23 Jun 2015 12:08:20 +0000 (14:08 +0200)]
Merge pull request #3228 from git-up/diff_merge

Explicitly handle GIT_DELTA_CONFLICTED in git_diff_merge()

9 years agoExplicitly handle GIT_DELTA_CONFLICTED in git_diff_merge()
Pierre-Olivier Latour [Wed, 17 Jun 2015 15:55:09 +0000 (08:55 -0700)]
Explicitly handle GIT_DELTA_CONFLICTED in git_diff_merge()

This fixes a bug where if a file was in conflicted state in either diff,
it would not always remain in conflicted state in the merged diff.