]> git.proxmox.com Git - libgit2.git/log
libgit2.git
8 years agoodb_loose: fix undefined behavior when computing size
Patrick Steinhardt [Mon, 2 May 2016 14:24:14 +0000 (16:24 +0200)]
odb_loose: fix undefined behavior when computing size

An object's size is computed by reading the object header's size
field until the most significant bit is not set anymore. To get
the total size, we increase the shift on each iteration and add
the shifted value to the total size.

We read the current value into a variable of type `unsigned
char`, from which we then take all bits except the most
significant bit and shift the result. We will end up with a
maximum shift of 60, but this exceeds the width of the value's
type, resulting in undefined behavior.

Fix the issue by instead reading the values into a variable of
type `unsigned long`, which matches the required width. This is
equivalent to git.git, which uses an `unsigned long` as well.

8 years agocheckout: set ignorecase=0 when config lookup fails
Patrick Steinhardt [Mon, 2 May 2016 13:47:54 +0000 (15:47 +0200)]
checkout: set ignorecase=0 when config lookup fails

When `git_repository__cvar` fails we may end up with a
`ignorecase` value of `-1`. As we subsequently check if
`ignorecase` is non-zero, we may end up reporting that data
should be removed when in fact it should not.

Err on the safer side and set `ignorecase = 0` when
`git_repository__cvar` fails.

8 years agomerge_file: do not unnecessarily check ours/theirs for NULL
Patrick Steinhardt [Mon, 2 May 2016 12:46:14 +0000 (14:46 +0200)]
merge_file: do not unnecessarily check ours/theirs for NULL

The `merge_file__xdiff` function checks if either `ours` or
`theirs` is `NULL`. The function is to be called with existing
files, though, and in fact already unconditionally dereferences
both pointers.

Remove the unnecessary check to silence warnings.

8 years agoindex: fix memory leak on error case
Patrick Steinhardt [Mon, 2 May 2016 12:30:14 +0000 (14:30 +0200)]
index: fix memory leak on error case

8 years agoMerge pull request #3764 from libgit2/ethomson/cmake_pc
Carlos Martín Nieto [Fri, 29 Apr 2016 16:34:03 +0000 (18:34 +0200)]
Merge pull request #3764 from libgit2/ethomson/cmake_pc

cmake: include threading libraries in pkg-config

8 years agocmake: include threading libraries in pkg-config
Edward Thomson [Fri, 29 Apr 2016 14:18:04 +0000 (10:18 -0400)]
cmake: include threading libraries in pkg-config

Include any required threading libraries in our `libgit2.pc`.

8 years agoMerge pull request #3763 from libgit2/ethomson/signature_from_buffer
Carlos Martín Nieto [Fri, 29 Apr 2016 08:36:01 +0000 (10:36 +0200)]
Merge pull request #3763 from libgit2/ethomson/signature_from_buffer

Introduce `git_signature_from_buffer`

8 years agoMerge pull request #3760 from backhub/bug/openssl_read
Edward Thomson [Fri, 29 Apr 2016 02:32:20 +0000 (22:32 -0400)]
Merge pull request #3760 from backhub/bug/openssl_read

Fix return value of openssl_read (infinite loop)

8 years agoIntroduce `git_signature_from_buffer`
Edward Thomson [Thu, 28 Apr 2016 16:47:14 +0000 (12:47 -0400)]
Introduce `git_signature_from_buffer`

Allow users to construct a signature from the type of signature
lines that actually appear in commits.

8 years agoFix style: no braces
Christian Schlack [Wed, 27 Apr 2016 11:56:16 +0000 (13:56 +0200)]
Fix style: no braces

8 years agoMerge pull request #3758 from libgit2/ethomson/annotated_commit_refs
Carlos Martín Nieto [Tue, 26 Apr 2016 19:21:27 +0000 (21:21 +0200)]
Merge pull request #3758 from libgit2/ethomson/annotated_commit_refs

Annotated commits: differentiate between the ref names and the description

8 years agoannotated_commit: provide refs and description
Edward Thomson [Tue, 26 Apr 2016 15:39:53 +0000 (11:39 -0400)]
annotated_commit: provide refs and description

Differentiate between the ref_name used to create an annotated_commit
(that can subsequently be used to look up the reference) and the
description that we resolved this with (which _cannot_ be looked up).

The description is used for things like reflogs (and may be a ref name,
and ID something that we revparsed to get here), while the ref name must
actually be a reference name, and is used for things like rebase to
return to the initial branch.

8 years agoFix return value of openssl_read (infinite loop)
Christian Schlack [Tue, 26 Apr 2016 16:04:03 +0000 (18:04 +0200)]
Fix return value of openssl_read (infinite loop)

openssl_read should return -1 in case of error.

SSL_read returns values <= 0 in case of error.

A return value of 0 can lead to an infinite loop, so the return value
of ssl_set_error will be returned if SSL_read is not successful (analog
to openssl_write).

8 years agorebase::abort: test we can abort rebase by revspec
Edward Thomson [Tue, 26 Apr 2016 15:48:11 +0000 (11:48 -0400)]
rebase::abort: test we can abort rebase by revspec

Test that we can properly abort a rebase when it is initialized by a
revspec.  This ensures that we do not conflate revspecs and refnames.

8 years agoMerge pull request #3755 from arthurschreiber/patch-9
Carlos Martín Nieto [Tue, 26 Apr 2016 11:40:03 +0000 (13:40 +0200)]
Merge pull request #3755 from arthurschreiber/patch-9

Remove traces of `git_blob_create_fromchunks`

8 years agoRemove traces of `git_blob_create_fromchunks`
Arthur Schreiber [Tue, 26 Apr 2016 09:10:31 +0000 (11:10 +0200)]
Remove traces of `git_blob_create_fromchunks`

8 years agoMerge pull request #3749 from arthurschreiber/arthur/add-git-reference-dup
Carlos Martín Nieto [Tue, 26 Apr 2016 09:02:45 +0000 (11:02 +0200)]
Merge pull request #3749 from arthurschreiber/arthur/add-git-reference-dup

Allow creating copies of `git_reference` objects.

8 years agoMerge pull request #3748 from libgit2/ethomson/rebase_detached
Carlos Martín Nieto [Tue, 26 Apr 2016 09:02:05 +0000 (11:02 +0200)]
Merge pull request #3748 from libgit2/ethomson/rebase_detached

Rebase improvements with IDs

8 years agoMerge pull request #3752 from libgit2/cmn/silly-tags
Edward Thomson [Mon, 25 Apr 2016 13:45:27 +0000 (09:45 -0400)]
Merge pull request #3752 from libgit2/cmn/silly-tags

tag: ignore extra header fields

8 years agotag: ignore extra header fields
Carlos Martín Nieto [Mon, 25 Apr 2016 10:16:05 +0000 (12:16 +0200)]
tag: ignore extra header fields

While no extra header fields are defined for tags, git accepts them by
ignoring them and continuing the search for the message. There are a few
tags like this in the wild which git parses just fine, so we should do
the same.

8 years agoAllow creating copies of `git_reference` objects.
Arthur Schreiber [Fri, 22 Apr 2016 17:34:17 +0000 (10:34 -0700)]
Allow creating copies of `git_reference` objects.

8 years agoMerge pull request #3747 from libgit2/ethomson/warnings
Carlos Martín Nieto [Fri, 22 Apr 2016 13:40:08 +0000 (15:40 +0200)]
Merge pull request #3747 from libgit2/ethomson/warnings

:zap: some warnings

8 years agorebase: correctly finish rebasing detached heads
Edward Thomson [Thu, 21 Apr 2016 22:16:37 +0000 (18:16 -0400)]
rebase: correctly finish rebasing detached heads

When rebasing with IDs, we do not return to the `branch`,
we remain in a detached HEAD state.

8 years agorebase: handle detached HEADs in `init`
Edward Thomson [Thu, 21 Apr 2016 21:29:19 +0000 (17:29 -0400)]
rebase: handle detached HEADs in `init`

When `init`ing a rebase from a detached HEAD, be sure to remember
that we were in a detached HEAD state so that we can correctly
`abort` the object that we just created.

8 years agorebase: test abort immediately after init
Edward Thomson [Thu, 21 Apr 2016 21:03:21 +0000 (17:03 -0400)]
rebase: test abort immediately after init

Instead of `open`ing a rebase and `abort`ing that, test that we can
`abort` a rebase that has just begun with `init`.

8 years agoclone test: annotate unused vars
Edward Thomson [Thu, 21 Apr 2016 15:05:21 +0000 (11:05 -0400)]
clone test: annotate unused vars

8 years agotransport: cast away constness for free
Edward Thomson [Thu, 21 Apr 2016 15:02:31 +0000 (11:02 -0400)]
transport: cast away constness for free

8 years agostransport: pass proxy opts instead of char*
Edward Thomson [Thu, 21 Apr 2016 15:01:09 +0000 (11:01 -0400)]
stransport: pass proxy opts instead of char*

8 years agoiterator: ignore submodule in has_ended
Edward Thomson [Thu, 21 Apr 2016 14:58:22 +0000 (10:58 -0400)]
iterator: ignore submodule in has_ended

8 years agoMerge pull request #3110 from libgit2/cmn/proxy-config
Edward Thomson [Tue, 19 Apr 2016 23:48:52 +0000 (19:48 -0400)]
Merge pull request #3110 from libgit2/cmn/proxy-config

Proxy configuration

8 years agoCI: download the proxy jar also on mingw
Carlos Martín Nieto [Tue, 19 Apr 2016 21:05:16 +0000 (23:05 +0200)]
CI: download the proxy jar also on mingw

We were downloading the jar from within an block which only runs for
MSVC. Move the download to the start of the test so it gets downloaded
for both.

8 years agoMerge pull request #3745 from libgit2/cmn/ignore-starstar
Edward Thomson [Tue, 19 Apr 2016 19:24:14 +0000 (15:24 -0400)]
Merge pull request #3745 from libgit2/cmn/ignore-starstar

Improve star-star matching

8 years agoignore: move star-star matching closer to it use
Carlos Martín Nieto [Mon, 18 Apr 2016 14:05:12 +0000 (16:05 +0200)]
ignore: move star-star matching closer to it use

Instead of threading the state down to the larger loop, let's have the
loop where we detect the double star so each of them are easier to read.

8 years agoignore: fix directory limits when searching for star-star
Carlos Martín Nieto [Mon, 18 Apr 2016 11:34:18 +0000 (13:34 +0200)]
ignore: fix directory limits when searching for star-star

In order to match the star-star, we disable the flag that's looking for
a single path element, but that leads to searching for the pattern in
the middle of elements in the input string.

Mark when we're handing a star-star so we jump over the elements in our
attempt to match the part of the pattern that comes after the star-star.

While here, tighten up the check so we don't allow invalid rules
through.

8 years agoCI: run proxy tests with ctest
Carlos Martín Nieto [Tue, 19 Apr 2016 08:50:30 +0000 (10:50 +0200)]
CI: run proxy tests with ctest

Running clar directly on appveyor makes it think the command returned
failure, so it stops the tests. Running it via ctest lets it go through.

8 years agoproxy: don't specify the protocol in the type
Carlos Martín Nieto [Mon, 14 Mar 2016 16:36:04 +0000 (17:36 +0100)]
proxy: don't specify the protocol in the type

We leave this up to the scheme in the url field. The type should only
tell us about whether we want a proxy and whether we want to auto-detect
it.

8 years agoCI: start the proxy before the build so it's ready
Carlos Martín Nieto [Mon, 14 Mar 2016 12:42:10 +0000 (13:42 +0100)]
CI: start the proxy before the build so it's ready

It takes a bit for the propxy to get ready to accept connections, so
start it before the build so we can be reasonably sure that it's going
to be ready in time.

8 years agowinhttp: correctly detect HTTPS usage
Carlos Martín Nieto [Wed, 30 Sep 2015 15:42:53 +0000 (17:42 +0200)]
winhttp: correctly detect HTTPS usage

8 years agocurl: ask for proxy credentials
Carlos Martín Nieto [Fri, 2 Oct 2015 08:11:43 +0000 (10:11 +0200)]
curl: ask for proxy credentials

8 years agoproxy: add a payload field for the proxy options
Carlos Martín Nieto [Fri, 2 Oct 2015 08:10:13 +0000 (10:10 +0200)]
proxy: add a payload field for the proxy options

I don't quite recall what we do in the other places where we use this,
but we should pass this payload to the callbacks.

8 years agonet: use proxy options struct in the stream config
Carlos Martín Nieto [Mon, 21 Sep 2015 20:38:50 +0000 (22:38 +0200)]
net: use proxy options struct in the stream config

8 years agoproxy: don't require the trailing slash on WinHTTP
Carlos Martín Nieto [Wed, 23 Sep 2015 02:39:05 +0000 (04:39 +0200)]
proxy: don't require the trailing slash on WinHTTP

The path is not something that you use for proxies, so make use of the
new optionality of the path when extracting URL parts.

8 years agoproxy: test proxy support on Travis
Carlos Martín Nieto [Mon, 21 Sep 2015 19:40:37 +0000 (21:40 +0200)]
proxy: test proxy support on Travis

8 years agonetops: make the path optional in URLs
Carlos Martín Nieto [Mon, 21 Sep 2015 19:11:02 +0000 (21:11 +0200)]
netops: make the path optional in URLs

When we're dealing with proxy addresses, we only want a hostname and
port, and the user would not provide a path, so make it optional so we
can use this same function to parse git as well as proxy URLs.

8 years agoproxy: use poxy to test our Windows proxy support
Carlos Martín Nieto [Wed, 29 Jul 2015 19:23:56 +0000 (21:23 +0200)]
proxy: use poxy to test our Windows proxy support

8 years agoproxy: ask the user for credentials if necessary
Carlos Martín Nieto [Thu, 7 May 2015 10:57:56 +0000 (12:57 +0200)]
proxy: ask the user for credentials if necessary

8 years agoproxy: introduce a proxy options struct
Carlos Martín Nieto [Mon, 11 May 2015 14:35:24 +0000 (16:35 +0200)]
proxy: introduce a proxy options struct

It is currently unused; it will go into the remote's options.

8 years agoAdd more tests for path matching with globs and path delimiters
Antonio Scandurra [Thu, 31 Mar 2016 15:38:40 +0000 (17:38 +0200)]
Add more tests for path matching with globs and path delimiters

8 years agoMerge pull request #3740 from Qix-/patch-1
Carlos Martín Nieto [Wed, 13 Apr 2016 09:51:05 +0000 (11:51 +0200)]
Merge pull request #3740 from Qix-/patch-1

Add missing ')' to callbacks documentation

8 years agoAdd missing ')' to callbacks documentation
Josh Junon [Wed, 13 Apr 2016 04:50:18 +0000 (21:50 -0700)]
Add missing ')' to callbacks documentation

Super minor, but it was bugging me.

There was a missing closing paren in the docs.

8 years agoMerge pull request #3738 from ethomson/test_as_root
Carlos Martín Nieto [Mon, 11 Apr 2016 22:14:00 +0000 (00:14 +0200)]
Merge pull request #3738 from ethomson/test_as_root

tests: skip the unreadable file tests as root

8 years agotests: skip the unreadable file tests as root
Edward Thomson [Mon, 11 Apr 2016 17:39:31 +0000 (13:39 -0400)]
tests: skip the unreadable file tests as root

When running as root, skip the unreadable file tests, because, well,
they're probably _not_ unreadable to root unless you've got some
crazy NSA clearance-level honoring operating system shit going on.

8 years agoMerge pull request #3736 from libgit2/cmn/dwim-general-message
Edward Thomson [Mon, 11 Apr 2016 17:29:54 +0000 (13:29 -0400)]
Merge pull request #3736 from libgit2/cmn/dwim-general-message

refs: provide a more general error message for dwim

8 years agoMerge pull request #3737 from ethomson/strict-object
Carlos Martín Nieto [Mon, 11 Apr 2016 17:24:47 +0000 (19:24 +0200)]
Merge pull request #3737 from ethomson/strict-object

Strict object creation in `refs::create`

8 years agorefs::create: strict object creation on by default
Edward Thomson [Mon, 11 Apr 2016 15:50:11 +0000 (11:50 -0400)]
refs::create: strict object creation on by default

When we turned strict object creation validation on by default, we
forgot to inform the refs::create tests of this.  They, in fact,
believed that strict object creation was off by default.  As a result,
their cleanup function went and turned strict object creation off for
the remaining tests.

8 years agoreset: use real ids for the tests
Carlos Martín Nieto [Mon, 11 Apr 2016 09:37:02 +0000 (11:37 +0200)]
reset: use real ids for the tests

This lets us run with strict object creation on.

8 years agorefs: provide a more general error message for dwim
Carlos Martín Nieto [Mon, 11 Apr 2016 15:43:07 +0000 (17:43 +0200)]
refs: provide a more general error message for dwim

If we cannot dwim the input, set the error message to be explicit about
that. Otherwise we leave the error for the last failed lookup, which
can be rather unexpected as it mentions a remote when the user thought
they were trying to look up a branch.

8 years agoMerge pull request #3730 from andhe/fix-stream-test
Edward Thomson [Wed, 6 Apr 2016 19:59:31 +0000 (15:59 -0400)]
Merge pull request #3730 from andhe/fix-stream-test

tests: fix core/stream test when built with openssl off

8 years agotests: fix core/stream test when built with openssl off
Andreas Henriksson [Wed, 6 Apr 2016 08:37:30 +0000 (10:37 +0200)]
tests: fix core/stream test when built with openssl off

When passing -DUSE_OPENSSL:BOOL=OFF to cmake the testsuite will
fail with the following error:

core::stream::register_tls [/tmp/libgit2/tests/core/stream.c:40]
  Function call failed: (error)
  error -1 - <no message>

Fix test to assume failure for tls when built without openssl.
While at it also fix GIT_WIN32 cpp to check if it's defined
or not.

8 years agoMerge pull request #3728 from libgit2/cmn/no-embed
Edward Thomson [Tue, 5 Apr 2016 18:47:02 +0000 (14:47 -0400)]
Merge pull request #3728 from libgit2/cmn/no-embed

Remove Makefile.embed

8 years agoRemove Makefile.embed
Carlos Martín Nieto [Tue, 5 Apr 2016 17:25:23 +0000 (13:25 -0400)]
Remove Makefile.embed

This has not been a supported build mode for quite some time, and it
correspondingly hasn't worked to build the library for a long time. Get
rid of it, as the only build mode we support is though CMakek.

8 years agoMerge pull request #3724 from ethomson/submodule_start_supports_silly_slashes
Carlos Martín Nieto [Sun, 3 Apr 2016 05:19:42 +0000 (22:19 -0700)]
Merge pull request #3724 from ethomson/submodule_start_supports_silly_slashes

iterator/diff: allow trailing `/` on start/end paths to match submodules

8 years agoMerge pull request #3723 from libgit2/cmn/ignore-symlink
Edward Thomson [Sat, 2 Apr 2016 20:52:53 +0000 (16:52 -0400)]
Merge pull request #3723 from libgit2/cmn/ignore-symlink

ignore: don't use realpath to canonicalize path

8 years agoiterator: support trailing `/` in start for submod
Edward Thomson [Sat, 2 Apr 2016 20:03:09 +0000 (13:03 -0700)]
iterator: support trailing `/` in start for submod

Allow callers to specify a start path with a trailing slash to match
a submodule, instead of just a directory.  This is for some legacy
behavior that's sort of dumb, but there it is.

8 years agodiff: test submodules are found with trailing `/`
Edward Thomson [Sat, 2 Apr 2016 18:33:00 +0000 (11:33 -0700)]
diff: test submodules are found with trailing `/`

Test that submodules are found when the are included in a pathspec
but have a trailing slash.

8 years agoignore: don't use realpath to canonicalize path
Carlos Martín Nieto [Fri, 1 Apr 2016 12:33:42 +0000 (14:33 +0200)]
ignore: don't use realpath to canonicalize path

If we're looking for a symlink, realpath will give us the resolved path,
which is not what we're after, but a canonicalized version of the path
the user asked for.

8 years agoMerge pull request #3720 from pks-t/pks/merge-driver-memleaks
Carlos Martín Nieto [Fri, 1 Apr 2016 11:09:50 +0000 (04:09 -0700)]
Merge pull request #3720 from pks-t/pks/merge-driver-memleaks

merge_driver: fix missing `goto done;`

8 years agomerge_driver: fix missing `goto done;`
Patrick Steinhardt [Fri, 1 Apr 2016 07:37:55 +0000 (09:37 +0200)]
merge_driver: fix missing `goto done;`

The code initializing the merge driver registry accidentally
forgot a `goto done` in case of an error. Because of this the
next line, which registers the global shutdown callback for the
merge drivers, is only called when an error occured.

Fix this by adding the missing `goto done`. This fixes some
memory leaks when the global state is shut down.

8 years agoMerge pull request #3719 from libgit2/ethomson/submodule_status
Carlos Martín Nieto [Fri, 1 Apr 2016 07:29:51 +0000 (00:29 -0700)]
Merge pull request #3719 from libgit2/ethomson/submodule_status

WD iterator: properly identify submodules

8 years agoiterator: use correct search function
Edward Thomson [Thu, 31 Mar 2016 19:05:34 +0000 (15:05 -0400)]
iterator: use correct search function

8 years agostatus: test submodules with mixed case
Edward Thomson [Thu, 31 Mar 2016 21:33:44 +0000 (17:33 -0400)]
status: test submodules with mixed case

8 years agoMerge pull request #3717 from libgit2/ethomson/leaks
Carlos Martín Nieto [Thu, 31 Mar 2016 21:04:43 +0000 (14:04 -0700)]
Merge pull request #3717 from libgit2/ethomson/leaks

Plug some leaks

8 years agoleaks: call `xdl_free_classifier`
Edward Thomson [Thu, 31 Mar 2016 14:43:57 +0000 (10:43 -0400)]
leaks: call `xdl_free_classifier`

8 years agoleaks: fix some leaks in the tests
Edward Thomson [Wed, 30 Mar 2016 21:47:05 +0000 (17:47 -0400)]
leaks: fix some leaks in the tests

8 years agoleaks: fix some iterator leaks
Edward Thomson [Wed, 30 Mar 2016 21:41:08 +0000 (17:41 -0400)]
leaks: fix some iterator leaks

8 years agoPlug a few leaks
Carlos Martín Nieto [Tue, 29 Mar 2016 12:47:31 +0000 (14:47 +0200)]
Plug a few leaks

8 years agoMerge pull request #3716 from libgit2/cmn/typedef-sizet
Edward Thomson [Thu, 31 Mar 2016 14:04:43 +0000 (10:04 -0400)]
Merge pull request #3716 from libgit2/cmn/typedef-sizet

Add a no-op size_t typedef for the doc parser

8 years agoMerge pull request #3575 from pmq20/master-13jan16
Carlos Martín Nieto [Thu, 31 Mar 2016 11:12:46 +0000 (04:12 -0700)]
Merge pull request #3575 from pmq20/master-13jan16

Remove duplicated calls to git_mwindow_close

8 years agoMerge pull request #3715 from pks-t/pks/xprepare-memleak
Carlos Martín Nieto [Thu, 31 Mar 2016 10:50:11 +0000 (03:50 -0700)]
Merge pull request #3715 from pks-t/pks/xprepare-memleak

xprepare memleaks

8 years agoAdd a no-op size_t typedef for the doc parser
Carlos Martín Nieto [Thu, 31 Mar 2016 09:35:53 +0000 (11:35 +0200)]
Add a no-op size_t typedef for the doc parser

Clang's documentation parser, which we use in our documentation system
does not report any comments for functions which use size_t as a type.

The root cause is buried somewhere in libclang but we can work around it
by defining the type ourselves. This typedef makes sure that libclang
sees it and that we do not change its size.

8 years agoxdiff/xprepare: fix a memory leak
Patrick Steinhardt [Thu, 31 Mar 2016 09:32:36 +0000 (11:32 +0200)]
xdiff/xprepare: fix a memory leak

The xdl_prepare_env() function may initialise an xdlclassifier_t
data structure via xdl_init_classifier(), which allocates memory
to several fields, for example 'rchash', 'rcrecs' and 'ncha'.
If this function later exits due to the failure of xdl_optimize_ctxs(),
then this xdlclassifier_t structure, and the memory allocated to it,
is not cleaned up.

In order to fix the memory leak, insert a call to xdl_free_classifier()
before returning.

This patch was originally written by Ramsay Jones (see commit
87f16258367a3b9a62663b11f898a4a6f3c19d31 in git.git).

8 years agoxdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
Patrick Steinhardt [Thu, 31 Mar 2016 09:30:31 +0000 (11:30 +0200)]
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits

Commit 307ab20b3 ("xdiff: PATIENCE/HISTOGRAM are not independent option
bits", 19-02-2012) introduced the XDF_DIFF_ALG() macro to access the
flag bits used to represent the diff algorithm requested. In addition,
code which had used explicit manipulation of the flag bits was changed
to use the macros.

However, one example of direct manipulation remains. Update this code to
use the XDF_DIFF_ALG() macro.

This patch was originally written by Ramsay Jones (see commit
5cd6978a9cfef58de061a9525f3678ade479564d in git.git).

8 years agoMerge pull request #3712 from ethomson/config_duplicate_section
Carlos Martín Nieto [Tue, 29 Mar 2016 10:26:43 +0000 (03:26 -0700)]
Merge pull request #3712 from ethomson/config_duplicate_section

config: don't write duplicate section

8 years agoMerge pull request #3703 from libgit2/cmn/multivar-set-locked
Edward Thomson [Mon, 28 Mar 2016 17:51:21 +0000 (13:51 -0400)]
Merge pull request #3703 from libgit2/cmn/multivar-set-locked

config: don't special-case multivars that don't exist yet

8 years agoconfig::write::repeated: init our buffer
Edward Thomson [Mon, 28 Mar 2016 15:56:13 +0000 (08:56 -0700)]
config::write::repeated: init our buffer

8 years agoconfig: don't write section header if we're in it
Edward Thomson [Mon, 28 Mar 2016 15:13:51 +0000 (11:13 -0400)]
config: don't write section header if we're in it

If we hit the EOF while trying to write a new value, it may be that
we're already in the section that we were looking for.  If so, do not
write a (duplicate) section header, just write the value.

8 years agoconfig: show we write a spurious duplicated section header
Carlos Martín Nieto [Fri, 4 Mar 2016 13:51:16 +0000 (14:51 +0100)]
config: show we write a spurious duplicated section header

We should notice that we are in the correct section to add. This is a
cosmetic bug, since replacing any of these settings does work.

8 years agoMerge pull request #3708 from sschuberth/master
Edward Thomson [Mon, 28 Mar 2016 13:50:31 +0000 (09:50 -0400)]
Merge pull request #3708 from sschuberth/master

CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P

8 years agoMerge pull request #3691 from ethomson/iterators
Carlos Martín Nieto [Sat, 26 Mar 2016 12:39:07 +0000 (05:39 -0700)]
Merge pull request #3691 from ethomson/iterators

Some FANTASTIC iterator refactoring

8 years agoiterator: comment fixed
Marc Strapetz [Tue, 22 Mar 2016 09:30:07 +0000 (10:30 +0100)]
iterator: comment fixed

8 years agoiterator: unused includes removed
Marc Strapetz [Tue, 22 Mar 2016 09:29:41 +0000 (10:29 +0100)]
iterator: unused includes removed

8 years agoiterator: new workdir-iterator test for pathlist + includings trees
Marc Strapetz [Tue, 22 Mar 2016 09:29:12 +0000 (10:29 +0100)]
iterator: new workdir-iterator test for pathlist + includings trees

8 years agoiterator: new index-iterator test for pathlist + includings trees
Marc Strapetz [Tue, 22 Mar 2016 09:28:50 +0000 (10:28 +0100)]
iterator: new index-iterator test for pathlist + includings trees

8 years agoiterator: more pathlist-related tests should test actual paths
Marc Strapetz [Tue, 22 Mar 2016 09:27:50 +0000 (10:27 +0100)]
iterator: more pathlist-related tests should test actual paths

8 years agoiterator: cleanups
Edward Thomson [Mon, 21 Mar 2016 21:19:24 +0000 (17:19 -0400)]
iterator: cleanups

Remove some unused functions, refactor some ugliness.

8 years agoiterator: don't run the gunk test by default on CI
Edward Thomson [Mon, 21 Mar 2016 22:30:21 +0000 (18:30 -0400)]
iterator: don't run the gunk test by default on CI

(It's slow!)

8 years agoiterator: refactor empty iterator to new style
Edward Thomson [Mon, 21 Mar 2016 21:03:00 +0000 (17:03 -0400)]
iterator: refactor empty iterator to new style

8 years agoiterator: mandate `advance_over`
Edward Thomson [Mon, 21 Mar 2016 20:51:45 +0000 (16:51 -0400)]
iterator: mandate `advance_over`

Since the three iterators implement `advance_over` differently,
mandate it and implement each.

8 years agoiterator: refactor index iterator
Edward Thomson [Mon, 21 Mar 2016 16:54:47 +0000 (12:54 -0400)]
iterator: refactor index iterator

8 years agoIntroduce `git_path_common_dirlen`
Edward Thomson [Fri, 18 Mar 2016 21:33:46 +0000 (17:33 -0400)]
Introduce `git_path_common_dirlen`