Commit Graph

141 Commits

Author SHA1 Message Date
Ben Straub
61d57b7a21 Test pushing to remotes with "file:///" urls 2013-09-04 14:27:59 -07:00
nulltoken
aec87f712f remote: Make git_remote_list() detect pushurl 2013-08-27 20:14:10 +02:00
nulltoken
c9ffa84bde remote: Relax the parsing logic even more
In order to be loaded, a remote needs to be configured with at least a `url` or a `pushurl`.

ENOTFOUND will be returned when trying to git_remote_load() a remote with neither of these entries defined.
2013-08-27 19:31:19 +02:00
nulltoken
ece24ef7c4 remote: Don't parse missing urls as empty strings 2013-08-27 16:57:17 +02:00
Carlos Martín Nieto
0b9ebb54ff remote: relax the url rules
Accept any value for the remote's url, including an empty string which
we used to reject as invalid configuration.

This is not quite what git does (although it has its own problems with
such configurations) and it makes it harder to fix the issue, by not
letting the user modify it.

As we already need to check for a valid URL when we try to connect to
the network, let that perform the check, as we don't need to do it
anywhere else.
2013-08-14 11:52:49 +02:00
Arthur Schreiber
edbaa63a7c Unbreak git_remote_ls on a local transport after disconnecting. 2013-06-25 09:04:04 +02:00
yorah
215af2ccb8 remote: make default tag retrieving behaviour consistent
Default for newly created remotes will be auto.
Default when loading existing remotes with no tag retrieving behaviour set, was already auto.
2013-05-30 17:59:11 +02:00
Michael Schubert
0582ae6fde tests: don't verify SSH unsupported with GIT_SSH 2013-05-27 12:12:27 +02:00
Edward Thomson
b6cc559a78 Merge pull request #1385 from carlosmn/refs-iter
Introduce a refs iterator
2013-05-11 02:42:49 -07:00
Carlos Martín Nieto
2b562c3a1e refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.

As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
2013-05-11 11:20:38 +02:00
Vicent Martí
ddc5c05421 Merge pull request #1561 from arrbee/fix-windows-diff-eofnl
Fix windows diff eofnl error
2013-05-09 05:42:37 -07:00
Russell Belfer
0f938c6b8f Fix win32 type warnings 2013-05-07 09:59:53 -07:00
Carlos Martín Nieto
505b5d0c81 remote: correctly interpret tagopt '--tags'
When tagopt is set to '--tags', we should only take the default tags
refspec into account and ignore any configured ones.

Bring the code into compliance.
2013-05-07 18:49:47 +02:00
Carlos Martín Nieto
1ffd0806f4 remote: add resfpec list accessors
Bring back a way of acessing the git_refspec* from a remote.

Closes #1514
2013-04-30 12:04:59 +02:00
Carlos Martín Nieto
d84884571d remote: dwim the refspecs according to the remote's advertised refs
As git allows you to store shorthand refspecs in the configuration, we
need to do this ourselves.
2013-04-28 18:49:51 +02:00
Carlos Martín Nieto
528a4e24c6 Parse shorthand refspecs as valid
Relax the ONELEVEL ref naming rules so the refspec parsing code can
ask for 'master' to be considered valid.
2013-04-28 14:21:10 +02:00
Carlos Martín Nieto
1be680c4d0 refspec: unify the string and parsed data
It used to be separate as an attempt to make the querying easier, but
it didn't work out that way, so put all the data together.

Add git_refspec_string() as well to get the original string, which is
now stored alongside the independent parts.
2013-04-20 19:45:40 +02:00
Carlos Martín Nieto
bc6374eac4 remote: allow querying for refspecs
Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs
from the remote and rename the refspec-adding functions to a less
silly name.

Use this instead of the vector index hacks in the tests.
2013-04-20 19:45:40 +02:00
Carlos Martín Nieto
4330ab26b5 remote: handle multiple refspecs
A remote can have a multitude of refspecs. Up to now our git_remote's
have supported a single one for each fetch and push out of simplicity
to get something working.

Let the remotes and internal code know about multiple remotes and get
the tests passing with them.

Instead of setting a refspec, the external users can clear all and add
refspecs. This should be enough for most uses, though we're still
missing a querying function.
2013-04-20 17:54:13 +02:00
nulltoken
24cb87e2a6 tag: Fix parsing when no tagger nor message 2013-03-31 14:36:51 +02:00
Russell Belfer
3ba0136243 Update cl_assert_equal_sz to be nicer
This makes the size_t comparison test nicer (assuming that the
values are actually not using the full length), and converts
some cases that were using it for pointer comparison to use the
macro that is designed for pointer comparison.
2013-03-22 14:23:38 -07:00
Edward Thomson
4cc326e9dd remote push test fix 2013-03-05 22:45:26 -06:00
Russell Belfer
9c258af094 Merge pull request #1316 from ben/clone-cancel
Allow network operations to cancel
2013-02-12 10:13:56 -08:00
nulltoken
2bca5b679b remote: Introduce git_remote_is_valid_name()
Fix libgit2/libgit2sharp#318
2013-02-11 23:19:41 +01:00
nulltoken
624924e876 remote: reorganize tests 2013-02-11 23:19:39 +01:00
Jameson Miller
db4bb4158f Teach refspec to transform destination reference to source reference 2013-02-11 11:36:28 -05:00
Ben Straub
fe95ac1b67 Allow progress callback to cancel fetch
This works by having the indexer watch the return
code of the callback, so will only take effect
on object boundaries.
2013-02-05 10:59:58 -08:00
Ben Straub
cd74cbba18 Plug test leaks 2013-01-31 14:38:22 -08:00
Ben Straub
cf7038a65c Enhance url parsing to include passwords 2013-01-31 14:04:21 -08:00
Ben Straub
7602cb7c0e Add user-from-url param to auth callback 2013-01-31 10:44:57 -08:00
Vicent Martí
4adb4815bf Merge pull request #1278 from sba1/cl-assert-equal-s
Use cl_assert_equal_s() instead of strcmp().
2013-01-25 20:37:39 -08:00
Philip Kelley
cfc39f5078 Fix 3 memory leaks 2013-01-25 22:43:52 -05:00
Sebastian Bauer
a7f8065f8c Use cl_assert_equal_s() instead of strcmp().
Replaced all cl_assert(!strcmp()) or semantically equivalent forms
by cl_assert_equal_s().
2013-01-25 06:55:56 +01:00
Sebastian Bauer
b90eb84ff9 Test that pushs properly fail for transports that don't provide a push implementation. 2013-01-17 22:32:37 +01:00
Carlos Martín Nieto
2086e1baef tests: plug a couple of leaks 2013-01-11 16:54:57 +01:00
Ben Straub
520dcc1c00 Move credential helpers to their own (optional) header 2013-01-09 13:31:17 -08:00
Ben Straub
ffb02b1630 Expose stock user/pass credential utility 2013-01-09 13:31:17 -08:00
Vicent Marti
7b51d675e8 Even more cleanups 2013-01-03 19:17:07 +01:00
Ben Straub
600d8dbf6d Move test cleanup into cleanup functions 2013-01-03 09:10:38 -08:00
Ben Straub
6fef1ab344 Tests should clean up after themselves 2013-01-03 07:47:51 -08:00
Vicent Marti
7761ce2162 Merge branch 'development' into clar2
Conflicts:
	tests-clar/clone/nonetwork.c
	tests-clar/online/clone.c
	tests-clar/online/fetchhead.c
2013-01-03 04:24:12 +01:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
Vicent Marti
156cfec096 Cleanup Clar to make it SIMPLER 2013-01-02 02:05:11 +01:00
nulltoken
19c3c99ca8 remote: remove duplicated test 2012-12-24 18:18:40 +01:00
nulltoken
f19304d265 remote: Prevent create() from blindly overwriting 2012-12-24 18:18:31 +01:00
nulltoken
b0aa14aa3c remote: Enhance in-memory remote test coverage 2012-12-24 16:54:27 +01:00
Ben Straub
2808ec9ab4 Rename test to make @nulltoken happy 2012-12-21 13:15:37 -08:00
Ben Straub
79000951ec In-memory remotes don't have names 2012-12-21 08:05:59 -08:00
Ben Straub
874dcb25eb Remote: deprecate dangling, prevent saving in-memory 2012-12-20 12:01:13 -08:00
Ben Straub
29f27599ea Rename remote creation APIs
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
2012-12-20 10:52:57 -08:00