Commit Graph

103 Commits

Author SHA1 Message Date
Carlos Martín Nieto
359dce726d remote: make _ls return the list directly
The callback-based method of listing remote references dates back to the
beginning of the network code's lifetime, when we didn't know any
better.

We need to keep the list around for update_tips() after disconnect() so
let's make use of this to simply give the user a pointer to the array so
they can write straightforward code instead of having to go through a
callback.
2013-11-11 15:35:51 +01:00
Carlos Martín Nieto
266af6d819 remote: don't allow such direct access to the refspecs
Removing arbitrary refspecs makes things more complex to reason
about. Instead, let the user set the fetch and push refspec list to
whatever they want it to be.
2013-11-10 22:21:25 +01:00
Carlos Martín Nieto
2f03050f4f remote: download HEAD when no refspecs are given
The correct behaviour when a remote has no refspecs (e.g. a URL from the
command-line) is to download the remote's HEAD. Let's do that.

This fixes #1261.
2013-11-01 22:47:06 +01:00
Carlos Martín Nieto
97d32abb49 Remove leftover function declaration 2013-10-30 15:15:54 +01:00
Carlos Martín Nieto
5cb136705d transport: let the progress output return an error
There are any number of issues that can come up in the progress
callback, and we should let the user cancel at that point as well.
2013-10-23 15:45:29 +02:00
Carlos Martín Nieto
0e0cf78773 clone: put the callbacks struct directly in the clone options
There's no need for this to be a pointer to somewhere else.
2013-10-02 14:04:44 +02:00
Carlos Martín Nieto
ffc97d5126 remote: add some comments to the callback struct
Hopefully clear up what they're for.
2013-10-02 06:42:27 +02:00
Carlos Martín Nieto
fe3a40a4ff remote: add a convenience 'fetch' function. 2013-10-02 06:41:42 +02:00
Carlos Martín Nieto
e3c131c544 remote: move the credentials callback to the struct
Move this one as well, letting us have a single way of setting the
callbacks for the remote, and removing fields from the clone options.
2013-10-02 06:41:42 +02:00
Carlos Martín Nieto
d31402a3fc remote: put the _download() callback with the others
The text progress and update_tips callbacks are already part of the
struct, which was meant to unify the callback setup, but the download
one was left out.
2013-10-02 06:41:42 +02:00
Carlos Martín Nieto
64061d4a14 remote: fix git_remote_download() documentation
The description of what the function does hasn't been true for quite a
while. Change it to reflect the way it currently works.

While here, remove an even older comment about missing features that
have been implemented.
2013-07-23 10:51:14 +02:00
Etienne Samson
85e1eded6a Add git_remote_owner 2013-07-15 16:31:25 +02:00
Andreas Linde
e196716457 Fixed most documentation header bugs
Fixed a few header @param and @return typos with the help of -Wdocumentation in Xcode.

The following warnings have not been fixed:
common.h:213 - Not sure how the documentation format is for '...'
notes.h:102 - Correct @param name but empty text
notes.h:111 - Correct @param name but empty text
pack.h:140 - @return missing text
pack.h:148 - @return missing text
2013-06-24 15:33:41 +02:00
yorah
df50512aeb Proposal to handle default value (auto = 0) 2013-05-30 18:06:54 +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
Nikolai Vladimirov
a952b9867d remove git_remote_pushspec 2013-04-23 21:28:28 +03: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
Carlos Martín Nieto
4a38143c93 remote: specify what values direction can mean in git_remote_connect()
This fixes #1487
2013-04-19 23:55:37 +02:00
nulltoken
2bca5b679b remote: Introduce git_remote_is_valid_name()
Fix libgit2/libgit2sharp#318
2013-02-11 23:19:41 +01:00
Ben Straub
3874f2d54f Kill vestigal dangling-remote code
Fixes #1232
2013-01-11 20:23:46 -08:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
nulltoken
f19304d265 remote: Prevent create() from blindly overwriting 2012-12-24 18:18:31 +01:00
nulltoken
ae35aa0708 remote: Improve documentation 2012-12-24 17:20:37 +01:00
nulltoken
b0aa14aa3c remote: Enhance in-memory remote test coverage 2012-12-24 16:54:27 +01:00
Ben Straub
79000951ec In-memory remotes don't have names 2012-12-21 08:05:59 -08:00
Ben Straub
87bc689fbf git_remote_create calls git_remote_save 2012-12-20 15:50:33 -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
Ben Straub
7c353afd0e Define constant for default fetch spec 2012-12-13 08:47:29 -08:00
Ben Straub
b914e17d82 API to set a dangling remote's repository 2012-12-12 12:23:24 -08:00
Ben Straub
a71c27ccda Allow creation of dangling remotes 2012-12-12 12:15:25 -08:00
Ben Straub
59bccf33c4 Add a payload param to git_cred_acquire_cb
Fixes #1128.
2012-12-10 11:11:01 -08:00
Ben Straub
fac43c54a6 Allow compilation as C++ 2012-12-06 19:41:52 -08:00
Vicent Martí
e05ca13f1f Merge pull request #1115 from ben/struct-versions
Version info for public structs
2012-12-05 11:47:19 -08:00
nulltoken
032ba9e4ad remote: deploy EINVALIDSPEC usage 2012-12-01 08:34:23 +01:00
Ben Straub
9267ff586f Deploy GIT_REMOTE_CALLBACKS_INIT 2012-11-30 13:12:15 -08:00
Ben Straub
bde336ea51 Add version fields and init macros for public input structs. 2012-11-30 12:55:45 -08:00
Ben Straub
f4a62c306d Typedef enums. 2012-11-27 14:13:03 -08:00
Ben Straub
df705148ec API updates for remote.h
Includes typedef for git_direction, and renames for
GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
2012-11-27 13:19:49 -08:00
Edward Thomson
b0f6e45d14 create FETCH_HEAD specially instead of as a ref file 2012-11-11 11:56:33 -06:00
Brian Schroeder
b0b8065880 Update documentation in remote.h 2012-11-08 21:28:15 -08:00
Philip Kelley
091361f569 Basic authentication for http and winhttp 2012-11-06 08:52:03 -05:00
Philip Kelley
41fb1ca0ec Reorganize transport architecture (squashed 3) 2012-11-01 09:02:33 -04:00
Russell Belfer
1b9346897b Merge pull request #925 from nulltoken/topic/moving-branch-updates-config
Updates config upon moving and deletion of branches
2012-10-25 10:55:03 -07:00
nulltoken
fcccf3045f remote: introduce git_remote_rename() 2012-10-25 17:42:36 +02:00
Ben Straub
1e3b8ed5cf Remove 'bytes' param from git_remote_download 2012-10-24 14:07:07 -07:00
Ben Straub
7d222e1312 Network progress: rename things
git_indexer_stats and friends -> git_transfer_progress*

Also made git_transfer_progress members more sanely
named.
2012-10-24 13:29:14 -07:00
Ben Straub
c4958e6818 Fix documentation comment 2012-10-24 12:38:05 -07:00