Commit Graph

9561 Commits

Author SHA1 Message Date
Carlos Martín Nieto
d45928cc0d 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.
2016-04-19 19:39:06 +02:00
Carlos Martín Nieto
1c3018eb12 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.
2016-04-19 19:39:05 +02:00
Carlos Martín Nieto
b8353236bc 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.
2016-04-19 13:54:27 +02:00
Carlos Martín Nieto
0d72f67f28 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.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
db01724fd9 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.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
bf6f7ad297 winhttp: correctly detect HTTPS usage 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
467e2cb1d7 curl: ask for proxy credentials 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
60d717c6f1 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.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
b373e9a6ba net: use proxy options struct in the stream config 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
22e6aa0d4f 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.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
2f3f1ee085 proxy: test proxy support on Travis 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
4e01741390 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.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
b117721dd8 proxy: use poxy to test our Windows proxy support 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
07bd3e57d9 proxy: ask the user for credentials if necessary 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
a7bece2014 proxy: introduce a proxy options struct
It is currently unused; it will go into the remote's options.
2016-04-19 13:54:19 +02:00
Antonio Scandurra
0f36271646 Add more tests for path matching with globs and path delimiters 2016-04-18 15:21:43 +02:00
Carlos Martín Nieto
029c93464f Merge pull request #3740 from Qix-/patch-1
Add missing ')' to callbacks documentation
2016-04-13 11:51:05 +02:00
Josh Junon
fc15befdcd Add missing ')' to callbacks documentation
Super minor, but it was bugging me.

There was a missing closing paren in the docs.
2016-04-12 21:50:18 -07:00
Carlos Martín Nieto
a2d3d2d3ac Merge pull request #3738 from ethomson/test_as_root
tests: skip the unreadable file tests as root
2016-04-12 00:14:00 +02:00
Edward Thomson
bbd65ad27e 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.
2016-04-11 15:32:38 -04:00
Edward Thomson
0e00eecf83 Merge pull request #3736 from libgit2/cmn/dwim-general-message
refs: provide a more general error message for dwim
2016-04-11 13:29:54 -04:00
Carlos Martín Nieto
b93b74b9e3 Merge pull request #3737 from ethomson/strict-object
Strict object creation in `refs::create`
2016-04-11 19:24:47 +02:00
Edward Thomson
d22a8b9583 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.
2016-04-11 11:50:11 -04:00
Carlos Martín Nieto
6d22ef7a51 reset: use real ids for the tests
This lets us run with strict object creation on.
2016-04-11 11:47:56 -04:00
Carlos Martín Nieto
77965c685d 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.
2016-04-11 17:47:03 +02:00
Edward Thomson
69723dd8d3 Merge pull request #3730 from andhe/fix-stream-test
tests: fix core/stream test when built with openssl off
2016-04-06 15:59:31 -04:00
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