Commit Graph

7336 Commits

Author SHA1 Message Date
Carlos Martín Nieto
2dc399a81d ssh: store error message immediately after a failed agent call
When the call to the agent fails, we must retrieve the error message
just after the function call, as other calls may overwrite it.

As the agent authentication is the only one which has a teardown and
there does not seem to be a way to get the error message from a stored
error number, this tries to introduce some small changes to store the
error from the agent.

Clearing the error at the beginning of the loop lets us know whether the
agent has already set the libgit2 error message and we should skip it,
or if we should set it.
2014-09-04 16:46:14 +02:00
Vicent Marti
89e05e2ab1 Merge pull request #2543 from libgit2/cmn/known-transports
Clean up transport lookup
2014-09-03 12:50:44 +02:00
Vicent Marti
4c958046d3 Merge pull request #2530 from libgit2/jamill/relative_gitlink
Teach repository to use relative paths for git symbolic links
2014-09-03 12:19:48 +02:00
Vicent Marti
eb939c5772 Merge pull request #2552 from KindDragon/master
Several CppCat warnings fixed
2014-09-03 12:19:03 +02:00
Jameson Miller
bc737620dd Introduce option to use relative paths for repository work directory
Teach git_repository_init_ext to use relative paths for the gitlink
to the work directory. This is used when creating a sub repository
where the sub repository resides in the parent repository's
.git directory.
2014-09-02 21:07:26 -04:00
Edward Thomson
0ee9f31c3b Introduce git_path_make_relative 2014-09-02 21:07:23 -04:00
Vicent Marti
6f3082d90f Merge pull request #2550 from KindDragon/patch-2
.editorconfig added to repository
2014-09-03 00:15:47 +02:00
Vicent Marti
0ac9f9a0c7 Merge pull request #2545 from linquize/no-ssh
Skip SSH clone tests if libgit2 not built with GIT_SSH defined
2014-09-03 00:13:23 +02:00
Arkady Shapkin
5cd81bb3d8 Several CppCat warnings fixed 2014-09-03 01:01:25 +04:00
Arkadiy Shapkin
098bb9dfb9 .editorconfig added to repository 2014-09-03 00:19:02 +04:00
Linquize
8deea5899d Add network::fetchlocal multi remotes test 2014-09-02 21:28:21 +08:00
Linquize
f49819aa90 When updating FETCH_HEAD, do not treat it as error if the remote of current branch is from another remote 2014-09-02 21:28:13 +08:00
Carlos Martín Nieto
15c30b72e1 clone: handle overly restrictive refspecs
When the fetch refspec does not include the remote's default branch, it
indicates an error in user expectations or programmer error. Error out
in that case.

This lets us get rid of the dummy refspec which can never work as its
zeroed out. In the cases where we did not find a default branch, we set
HEAD detached immediately, which lets us refactor the "normal" path,
removing `found_branch`.
2014-09-02 13:23:54 +02:00
Carlos Martín Nieto
e128a1af6e clone: correct handling of an unborn HEAD
If the remote does not advertise HEAD, then it is unborn and we cannot
checkout that branch. Handle it the same way as an empty repo.
2014-09-02 13:10:19 +02:00
Carlos Martín Nieto
538f908175 remote: add test for single-branch clone
When cloning, we may be asking for a particular branch or subset of
branches. Make sure we test for that.
2014-09-02 12:47:12 +02:00
Carlos Martín Nieto
f2ffab618a remote: add tests for remote-branch edge cases
Add tests for the case when there are no branches on the remote and when
HEAD is detached but has the id of a non-branch. In both of these cases,
we should return ENOTFOUND.
2014-09-02 12:47:12 +02:00
Vicent Marti
d4cb23e4e5 Merge pull request #2548 from linquize/warning5
Fix warning
2014-09-01 18:29:54 +02:00
Linquize
bd465f9c22 Fix warning 2014-09-01 23:36:12 +08:00
Linquize
fe3b67891b Skip SSH clone tests if libgit2 not built with GIT_SSH defined 2014-09-01 19:18:20 +08:00
Carlos Martín Nieto
05ac70514f remote: test for supported URLs in a single place
Instead of using ifdefs to run the tests, use them to set when we expect
to support a particular scheme and always have the tests in the code.
2014-08-31 21:53:42 +02:00
Carlos Martín Nieto
ba67c07522 remote: get rid of git_remote_valid_url()
It does the same as git_remote_supported_url() but has a name which
implies we'd check the URL for correctness while we're simply looking at
the scheme and looking it up in our lists.

While here, fix up the tests so we check all the combination of what's
supported.
2014-08-31 21:50:28 +02:00
Carlos Martín Nieto
bd3854a09c transport: return ENOTFOUND for HTTPS and SSH when they're not supported
The previous commit makes it harder to figure out if the library was
built with support for a particular transport. Roll back some of the
changes and remove ssh:// and https:// from the list if we're being
built without support for them.
2014-08-31 18:01:44 +02:00
Carlos Martín Nieto
dbc77850ff transport: distinguish between unknown and unsupported transports
Even when built without a SSH support, we know about this transport. It
is implemented, but the current code makes us return an error message
saying it's not.

This is a leftover from the initial implementation of the transports
when there were in fact transports we knew about but were not
implemented.

Instead, let the SSH transport itself say it cannot run, the same as we
do for HTTPS.
2014-08-31 18:01:35 +02:00
Vicent Marti
69b584593e Merge pull request #2544 from linquize/test-push
MSVC does not support zero size array
2014-08-31 17:47:14 +02:00
Linquize
aff7001825 MSVC does not support zero size array 2014-08-31 22:43:53 +08:00
Vicent Marti
46a13f3247 Merge pull request #2481 from libgit2/cmn/oidarray
merge: expose multiple merge bases
2014-08-29 18:19:56 +02:00
Carlos Martín Nieto
46254467cf clone: support remotes with references but no branches
A repository can have any number of references which we're not
interested in such as notes or tags. For the default branch calculation
we only care about branches. Make the decision about the number of
branches rather than the number of refs in general.
2014-08-29 15:28:10 +02:00
Carlos Martín Nieto
0cdaa3766a remote: short-circuit the default branch check if there is none
If we do not have a HEAD ref in the heads, we already know there is no
default branch. Return immedately.
2014-08-29 15:28:10 +02:00
Carlos Martín Nieto
94412b009e remote: assert what we want to happen when ther is no default branch
Assert what we already do, so as to notice changes.
2014-08-29 15:28:10 +02:00
Carlos Martín Nieto
26bf3a5346 travis: no need to clean out the test repository
This was added to avoid the remote's default branch to be considered to
the be notes one which the first network test leaves behind.
2014-08-29 15:28:10 +02:00
Carlos Martín Nieto
389526043a remote: restrict default branch to branches namespace 2014-08-29 15:27:36 +02:00
Vicent Marti
d99c8ca178 Merge pull request #2539 from libgit2/cmn/ahead-behind-order
Fix ahead-behind results
2014-08-28 16:33:53 +02:00
Carlos Martín Nieto
05f0d0c119 graph: fix ahead-behind logic
When we see PARENT1, it means there is a local commit and thus we are
ahead. Likewise, seeing PARENT2 means that the upstream branch has a
commit and we are one more behind.

The logic is currently reversed. Correct it.

This fixes #2501.
2014-08-28 13:36:58 +02:00
Carlos Martín Nieto
e07aebb4e2 Fix ahead-behind tests
The logic was reversed. I have checked manually each pair with git and
adjusted the expectation to what git status prints.
2014-08-28 13:34:42 +02:00
Vicent Marti
69db893427 Merge pull request #2538 from libgit2/ntk/propagate_url_parsing_error
winhttp: Prevent swallowing of url parsing error
2014-08-27 19:19:55 +02:00
Vicent Marti
893cfe0649 Merge pull request #2502 from rnowosielski/remote_set_timeout
Set timeout on remote (Add timeout for WinHttpReceiveResponse #2147)
2014-08-27 19:18:46 +02:00
Vicent Marti
1485c6833a Merge pull request #2490 from csware/ssh-wintunnel
Allow to override default ssh transport_cb - in order to allow third party ssh transports
2014-08-27 18:02:10 +02:00
nulltoken
f0c53d21a4 winhttp: Prevent swallowing of url parsing error 2014-08-27 17:37:29 +02:00
Sven Strickroth
0e5bb61992 Added some tests
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-27 17:27:07 +02:00
Carlos Martín Nieto
c13b68442f Adjust clone tests to USERNAME cred type 2014-08-27 15:25:46 +02:00
Carlos Martín Nieto
15c7da3442 Merge branch 'cmn/ssh-retry' 2014-08-27 15:10:51 +02:00
Carlos Martín Nieto
7449c82ee7 Add ssh retry changes to CHANGELOG 2014-08-27 15:10:43 +02:00
Carlos Martín Nieto
6a0d2b43ee Merge remote-tracking branch 'upstream/master' into cmn/ssh-retry 2014-08-27 15:09:07 +02:00
Rafal Nowosielski
86d0a53cd6 Set timeout on remote (WinHTTP) should return error in case of failure. Connection timeout set to 1 minute. Read/Write timeout remains set to infinite #2147 2014-08-27 15:07:04 +02:00
Vicent Marti
cb92467bc2 Merge pull request #2537 from libgit2/reduce-cache-contention
Refactor git_cache to use an rwlock
2014-08-27 01:16:11 +02:00
Justin Spahr-Summers
6a211d7c9a Refactor git_cache to use an rwlock
This significantly reduces contention when many threads are trying to
read from the cache simultaneously.
2014-08-26 15:12:43 -07:00
Vicent Marti
00e9ae5ab4 Merge pull request #2508 from libgit2/rb/fix-ignore-slash-star
Fix bugs with negative ignores inside an ignored parent directory
2014-08-26 17:48:20 +02:00
Vicent Marti
cd0c4fa73a Merge pull request #2533 from jakebolewski/jcb/addjulia
add Julia to the language bindings list
2014-08-26 17:46:52 +02:00
Vicent Marti
397bc8d897 Merge pull request #2535 from libgit2/cmn/unpack-offset
pack: return the correct final offset
2014-08-26 17:45:07 +02:00
Sven Strickroth
34e510cedf Allow to override default ssh transport_cb
W/o this patch it is not possible to have a third party ssh transport_cb if GIT_SSH is disabled or a third party transport_cb which has a higher priority than the default one.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-26 17:18:52 +02:00