Commit Graph

9535 Commits

Author SHA1 Message Date
Andreas Henriksson
04f47a43f9 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.
2016-04-06 15:00:32 +02:00
Edward Thomson
54cfee6d88 Merge pull request #3728 from libgit2/cmn/no-embed
Remove Makefile.embed
2016-04-05 14:47:02 -04:00
Carlos Martín Nieto
21ba34618b 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.
2016-04-05 13:25:23 -04:00
Carlos Martín Nieto
381caf5690 Merge pull request #3724 from ethomson/submodule_start_supports_silly_slashes
iterator/diff: allow trailing `/` on start/end paths to match submodules
2016-04-02 22:19:42 -07:00
Edward Thomson
7018e3b747 Merge pull request #3723 from libgit2/cmn/ignore-symlink
ignore: don't use realpath to canonicalize path
2016-04-02 16:52:53 -04:00
Edward Thomson
d47f7e1c15 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.
2016-04-02 13:34:55 -07:00
Edward Thomson
2e0391f4f1 diff: test submodules are found with trailing /
Test that submodules are found when the are included in a pathspec
but have a trailing slash.
2016-04-02 13:02:41 -07:00
Carlos Martín Nieto
d364dc8b39 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.
2016-04-02 21:32:28 +02:00
Carlos Martín Nieto
36fc25572c Merge pull request #3720 from pks-t/pks/merge-driver-memleaks
merge_driver: fix missing `goto done;`
2016-04-01 04:09:50 -07:00
Patrick Steinhardt
83c93a7cc2 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.
2016-04-01 09:37:55 +02:00
Carlos Martín Nieto
1cac688d3f Merge pull request #3719 from libgit2/ethomson/submodule_status
WD iterator: properly identify submodules
2016-04-01 00:29:51 -07:00
Edward Thomson
4df6ddaa1a iterator: use correct search function 2016-03-31 17:58:43 -04:00
Edward Thomson
74ab5f2cd0 status: test submodules with mixed case 2016-03-31 17:58:43 -04:00
Carlos Martín Nieto
24ecf18e81 Merge pull request #3717 from libgit2/ethomson/leaks
Plug some leaks
2016-03-31 14:04:43 -07:00
Edward Thomson
c4aa5c042c leaks: call xdl_free_classifier 2016-03-31 10:43:57 -04:00
Edward Thomson
17442b28f9 leaks: fix some leaks in the tests 2016-03-31 10:41:33 -04:00
Edward Thomson
9705483342 leaks: fix some iterator leaks 2016-03-31 10:41:33 -04:00
Carlos Martín Nieto
f5c874a475 Plug a few leaks 2016-03-31 10:41:33 -04:00
Edward Thomson
1694a63994 Merge pull request #3716 from libgit2/cmn/typedef-sizet
Add a no-op size_t typedef for the doc parser
2016-03-31 10:04:43 -04:00
Carlos Martín Nieto
d53cc13e3a Merge pull request #3575 from pmq20/master-13jan16
Remove duplicated calls to git_mwindow_close
2016-03-31 04:12:46 -07:00
Carlos Martín Nieto
bd4ef3373b Merge pull request #3715 from pks-t/pks/xprepare-memleak
xprepare memleaks
2016-03-31 03:50:11 -07:00
Carlos Martín Nieto
9844453611 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.
2016-03-31 11:55:47 +02:00
Patrick Steinhardt
6045afd398 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).
2016-03-31 11:34:03 +02:00
Patrick Steinhardt
1bce14874f 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).
2016-03-31 11:33:40 +02:00
Carlos Martín Nieto
2f0450f4d6 Merge pull request #3712 from ethomson/config_duplicate_section
config: don't write duplicate section
2016-03-29 03:26:43 -07:00
Edward Thomson
b085ecbe09 Merge pull request #3703 from libgit2/cmn/multivar-set-locked
config: don't special-case multivars that don't exist yet
2016-03-28 13:51:21 -04:00
Edward Thomson
76e1a679ea config::write::repeated: init our buffer 2016-03-28 08:56:13 -07:00
Edward Thomson
e25e1ca1b2 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.
2016-03-28 11:13:51 -04:00
Carlos Martín Nieto
3e95bd36d9 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.
2016-03-28 10:47:14 -04:00
Edward Thomson
e89abec69f Merge pull request #3708 from sschuberth/master
CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P
2016-03-28 09:50:31 -04:00
Carlos Martín Nieto
7b29be31c2 Merge pull request #3691 from ethomson/iterators
Some FANTASTIC iterator refactoring
2016-03-26 05:39:07 -07:00
Marc Strapetz
d6713ec64e iterator: comment fixed 2016-03-24 15:59:49 -04:00
Marc Strapetz
f4777058d0 iterator: unused includes removed 2016-03-24 15:59:49 -04:00
Marc Strapetz
c017c18361 iterator: new workdir-iterator test for pathlist + includings trees 2016-03-24 15:59:49 -04:00
Marc Strapetz
09064f15c5 iterator: new index-iterator test for pathlist + includings trees 2016-03-24 15:59:49 -04:00
Marc Strapetz
8152a74821 iterator: more pathlist-related tests should test actual paths 2016-03-24 15:59:49 -04:00
Edward Thomson
9eb9e5fa87 iterator: cleanups
Remove some unused functions, refactor some ugliness.
2016-03-24 15:59:49 -04:00
Edward Thomson
d712c2b27f iterator: don't run the gunk test by default on CI
(It's slow!)
2016-03-24 15:59:48 -04:00
Edward Thomson
35877463fd iterator: refactor empty iterator to new style 2016-03-24 15:59:48 -04:00
Edward Thomson
247e3b4305 iterator: mandate advance_over
Since the three iterators implement `advance_over` differently,
mandate it and implement each.
2016-03-24 15:59:48 -04:00
Edward Thomson
0ef0b71ca5 iterator: refactor index iterator 2016-03-24 15:59:48 -04:00
Edward Thomson
ba6f86eb2e Introduce git_path_common_dirlen 2016-03-24 15:59:48 -04:00
Edward Thomson
82a1aab647 iterator: move the index into the iterator itself 2016-03-24 15:59:48 -04:00
Edward Thomson
de034cd239 iterator: give the tests a proper hierarchy
Iterator tests were split over repo::iterator and diff::iterator,
with duplication between the two.  Move them to iterator::index,
iterator::tree, and iterator::workdir.
2016-03-24 15:59:48 -04:00
Carlos Martín Nieto
d4763c9861 Merge pull request #3574 from chescock/buffer-sideband-pack-data
Buffer sideband packet data
2016-03-24 06:56:25 -07:00
Sebastian Schuberth
035430b7f3 CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P 2016-03-24 14:10:29 +01:00
Jeff Hostetler
df25daef9b Added clar test for #3568 2016-03-23 17:17:02 -04:00
Edward Thomson
6788553231 diff: stop processing nitem when its removed
When a directory is removed out from underneath us, stop trying to
manipulate it.
2016-03-23 17:17:02 -04:00
Edward Thomson
0a2e10328a iterator: drop advance_into_or_over
Now that iterators do not return `GIT_ENOTFOUND` when advancing
into an empty directory, we do not need a special `advance_into_or_over`
function.
2016-03-23 17:17:02 -04:00
Edward Thomson
6cd9573f54 iterator: test that we can advance_into empty dirs
Prior iterator implementations returned `GIT_ENOTFOUND` when
trying to advance into empty directories.  Ensure that we no longer
do that and simply handle them gracefully.
2016-03-23 17:17:02 -04:00