summaryrefslogtreecommitdiff
path: root/src/remote.c
Commit message (Collapse)AuthorAgeFilesLines
...
* remote: add accessors for the autotag settingCarlos Martín Nieto2012-09-301-0/+10
|
* remote: create tags if we have themCarlos Martín Nieto2012-09-301-7/+48
| | | | | | Together with include-tag, this make us behave more like git. After a fetch, try to create any tags the remote told us about for which we have objects locally.
* fetch: use the include-tag capabilityCarlos Martín Nieto2012-09-301-0/+28
| | | | | This tells the remote to send us any tags that point to objects that we are downloading.
* refspec: add git_refspec__free, remove git_refspec_parseCarlos Martín Nieto2012-09-301-4/+2
| | | | | | | The latter shouldn't be exposed and isn't used, git_refspec__parse supersedes it. Fix a leak in the refspec tests while we're at it.
* network: add sideband supportCarlos Martín Nieto2012-08-241-0/+8
| | | | | This lets us notify the user of what the remote end is doing while we wait for it to start sending us the packfile.
* oid: Explicitly include `oid.h` for the inlined CMPVicent Marti2012-08-091-0/+1
|
* Fix iterator check and return valueRussell Belfer2012-08-061-1/+6
| | | | | | | | | There is a little cleanup necessary from PR #843. Since the new callbacks return `GIT_EUSER` we have to be a little careful about return values when they are used internally to the library. Also, callbacks should be checked for non-zero return values, not just less than zero.
* remotes: Proper return for `git_remote_ls`Vicent Marti2012-08-061-4/+2
|
* remote: add missing include git2/remote.hMichael Schubert2012-08-041-1/+0
| | | | | Otherwise we get an incomplete type error, since git_remote_callbacks isn't declared yet.
* transport: store the refs in a common areaCarlos Martín Nieto2012-07-301-1/+20
| | | | | | | | Instad of each transport having its own function and logic to get to its refs, store them directly in transport. Leverage the new gitno_buffer to make the parsing and storing of the refs use common code and get rid of the git_protocol struct.
* Merge pull request #834 from carlosmn/network-callbacksVicent Martí2012-07-271-3/+10
|\ | | | | Add a struct for network callbacks
| * Add a struct for network callbacksCarlos Martín Nieto2012-07-211-3/+10
| | | | | | | | | | Currently only update_tips is used, but it prepares the way for progress output during download.
* | remote: fix C99-ismCarlos Martín Nieto2012-07-271-1/+2
| |
* | Remotes: Use correct url in git_remote_connectSascha Cunz2012-07-271-1/+20
| |
* | Remotes: Save a cleaned pushurl (by deleting it from the config)Sascha Cunz2012-07-271-4/+13
| |
* | Remotes: Setter for url+pushurl; Getter for pushurlSascha Cunz2012-07-261-0/+32
| |
* | Remotes: Load/Save for fetch.foo.pushurlSascha Cunz2012-07-261-0/+32
| |
* | Remove unneccessary string transformationSascha Cunz2012-07-261-1/+1
| |
* | update_tips: report error if it fails to create a refCarlos Martín Nieto2012-07-241-1/+1
|/
* misc: Fix warnings from PVS Studio trialVicent Martí2012-06-071-2/+5
|
* Merge pull request #697 from carlosmn/sslVicent Martí2012-06-051-0/+10
|\ | | | | Add HTTPS support
| * ssl: allow skipping the server certificate checkCarlos Martín Nieto2012-05-261-0/+10
| | | | | | | | | | Sometimes it's useful not to perform the check. Allow it to be configurable.
* | remote: Make git_remote_add() generate a default refspec with a force update ↵nulltoken2012-06-041-1/+1
| | | | | | | | specifier
* | refspec: expose the force update specifier through git_refspec_force() accessornulltoken2012-05-301-0/+4
|/
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-4/+4
|
* errors: Rename the generic return codesVicent Martí2012-05-181-5/+5
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-2/+2
| | | | Consistency is good.
* fetch: filter tag annotation pseudo-refs while generating wantsCarlos Martín Nieto2012-05-091-4/+0
| | | | | | | These objects aren't considered as being advertised, so asking for them will cause the remote end to close the connection. This makes the checking in update_tips() unnecessary, because they don't get inserted in the list.
* remote: don't try to create tag annotations as refs/tags/v0.1.0^{}Carlos Martín Nieto2012-05-091-0/+4
| | | | | Skip them for now. Eventually we might want to filter these out earler.
* remotes: change git_remote_new's signatureCarlos Martín Nieto2012-05-081-6/+13
| | | | | Add a fetch refspec arguemnt and make the arguments (name, url, refspec), as that order makes more sense.
* remote: add git_remote_add()Carlos Martín Nieto2012-05-081-0/+25
| | | | Helper function to create a remote with the default settings
* remote: make git_remote_load() return GIT_ENOTFOUND when the remote url ↵nulltoken2012-05-081-3/+1
| | | | cannot be retrieved from the config file
* remote: ensure the allocated remote is freed when an error occurs during its ↵nulltoken2012-05-081-8/+16
| | | | loading
* remote: don't free transport on disconnectMichael Schubert2012-05-021-8/+10
| | | | | | | | | | | | | | | | | | | | | | Currently, git_remote_disconnect not only closes the connection but also frees the underlying transport object, making it impossible to write code like // fetch stuff git_remote_download() // close connection git_remote_disconnect() // call user provided callback for each ref git_remote_update_tips(remote, callback) because remote->refs points to references owned by the transport object. This means, we have an idling connection while running the callback for each reference. Instead, allow immediate disconnect and free the transport later in git_remote_free().
* Merge pull request #642 from arrbee/mem-poolsRussell Belfer2012-04-251-1/+1
|\ | | | | Memory pools and khash hashtables
| * Implement git_pool paged memory allocatorRussell Belfer2012-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a `git_pool` object that can do simple paged memory allocation with free for the entire pool at once. Using this, you can replace many small allocations with large blocks that can then cheaply be doled out in small pieces. This is best used when you plan to free the small blocks all at once - for example, if they represent the parsed state from a file or data stream that are either all kept or all discarded. There are two real patterns of usage for `git_pools`: either for "string" allocation, where the item size is a single byte and you end up just packing the allocations in together, or for "fixed size" allocation where you are allocating a large object (e.g. a `git_oid`) and you generally just allocation single objects that can be tightly packed. Of course, you can use it for other things, but those two cases are the easiest.
* | remote: run a callback when updating the branch tipsCarlos Martín Nieto2012-04-251-3/+23
| | | | | | | | | | | | | | | | This allows the caller to update an internal structure or update the user output with the tips that were updated. While in the area, only try to update the ref if the value is different from its old one.
* | fetch: use the streaming indexer when downloading a packCarlos Martín Nieto2012-04-251-3/+3
|/ | | | | | | | This changes the git_remote_download() API, but the existing one is silly, so you don't get to complain. The new API allows to know how much data has been downloaded, how many objects we expect in total and how many we've processed.
* error-handling: remote, transportCarlos Martín Nieto2012-04-111-145/+101
|
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-2/+2
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Add git_remote_list()Carlos Martín Nieto2012-02-261-0/+69
| | | | | Loops through the configuration and generates a list of configured remotes.
* A remote exists with an URL aloneCarlos Martín Nieto2012-02-241-0/+3
| | | | | | | We used to consider it an error if a remote didn't have at least a fetch refspec. This was too much checking, as a remote doesn't in fact need to have anything other than an URL configured to be considered a remote.
* Fix check for writing remote's fetch and push configurationsCarlos Martín Nieto2012-02-211-2/+2
| | | | Fix copy-paste error
* Move git_remote_load() to git_bufCarlos Martín Nieto2012-02-201-22/+16
|
* Add git_remote_save()Carlos Martín Nieto2012-02-201-0/+50
|
* Add git_remote_set_{fetch,push}spec()Carlos Martín Nieto2012-02-201-0/+38
| | | | | Allow setting the fetch and push refspecs, which is useful for creating new refspecs.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* remote: don't try to free the ref on errorCarlos Martín Nieto2012-01-191-1/+2
| | | | On error, the pointer could be pointing anywhere.
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-8/+8
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* remote: Fix connected testVicent Marti2011-11-281-1/+1
|