summaryrefslogtreecommitdiff
path: root/src/fetchhead.c
Commit message (Collapse)AuthorAgeFilesLines
* fetchhead: deal with quotes in branch namesCarlos Martín Nieto2014-04-241-1/+1
| | | | | | | | | The current FETCH_HEAD parsing code assumes that a quote must end the branch name. Git however allows for quotes as part of a branch name, which causes us to consider the FETCH_HEAD file as invalid. Instead of searching for a single quote char, search for a quote char followed by SP, which is not a valid part of a ref name.
* One more rename/cleanup for callback err functionsRussell Belfer2013-12-111-1/+1
|
* Some callback error check style cleanupsRussell Belfer2013-12-111-5/+6
| | | | I find this easier to read...
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Further EUSER and error propagation fixesRussell Belfer2013-12-111-2/+2
| | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* Merge pull request #1956 from libgit2/cmn/fetch-default-headVicent Martí2013-11-111-0/+6
|\ | | | | Remote revamp (director's cut)
| * remote: create FETCH_HEAD with a refspecless remoteCarlos Martín Nieto2013-11-011-0/+6
| | | | | | | | | | | | When downloading the default branch due to lack of refspecs, we still need to write out FETCH_HEAD with the tip we downloaded, unfortunately with a format that doesn't match what we already have.
* | move mode_t to filebuf_open instead of _commitEdward Thomson2013-11-041-2/+2
|/
* immutable references and a pluggable ref databaseEdward Thomson2013-03-071-1/+0
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Fix -Wmaybe-uninitialized warningMichael Schubert2012-12-221-1/+1
|
* fetchhead reading/iteratingEdward Thomson2012-12-191-8/+178
|
* create FETCH_HEAD specially instead of as a ref fileEdward Thomson2012-11-111-0/+126