summaryrefslogtreecommitdiff
path: root/src/fetch.c
Commit message (Collapse)AuthorAgeFilesLines
...
* *: correct and codify various file permissionsBrodie Rao2011-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following files now have 0444 permissions: - loose objects - pack indexes - pack files - packs downloaded by fetch - packs downloaded by the HTTP transport And the following files now have 0666 permissions: - config files - repository indexes - reflogs - refs This brings libgit2 more in line with Git. Note that git_filebuf_commit() and git_filebuf_commit_at() have both gained a new mode parameter. The latter change fixes an important issue where filebufs created with GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3) usage). Now we chmod() the file before renaming it into place. Tests have been added to confirm that new commit, tag, and tree objects are created with the right permissions. I don't have access to Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
* fetch: add a generic pack-download functionCarlos Martín Nieto2011-10-121-0/+58
| | | | | | | Taken mostly from the git transport's version, this can be used by any transport that takes its pack data from the network. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* transport: don't have an extra send-wants stepCarlos Martín Nieto2011-10-121-6/+1
| | | | | | | It's a bit awkward to run it as an extra step, and HTTP may need to send the wants list several times. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* fetch: move 'head' so it's visible to the whole functionCarlos Martín Nieto2011-10-091-1/+2
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* fetch: store FETCH_HEADCarlos Martín Nieto2011-10-081-2/+19
| | | | | | We should always save the remote's HEAD as FETCH_HEAD locally. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* A missing refspec is not an errorCarlos Martín Nieto2011-10-081-4/+6
| | | | | | | It's rare for a configured remote, but for one given as an URL on the command line, it's more often than not the case. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Cleanup legal dataVicent Marti2011-09-191-21/+3
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Don't hide the transport detailsCarlos Martín Nieto2011-08-301-4/+5
| | | | | | | Transports shouldn't get used outside of the library, so don't expose accessor functions. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Actually implement object negotiationCarlos Martín Nieto2011-08-181-1/+5
| | | | | | | | Only signal that we need a pack if we do need it and don't send a want just because it's the first. If we don't need to download the pack, then we can skip all of the negotiation and just return success. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move negotiation to the transportCarlos Martín Nieto2011-08-181-46/+4
| | | | | | | | | There are many ways how a transport might negotiate with the server, so instead of making it fit into the smart protocol model, let the transport do its thing. For now, the git protocol limits itself to send only 160 "have" lines so we don't flood the server. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Use time sorting in fetchCarlos Martín Nieto2011-08-181-0/+1
| | | | | | This is what the docs say tha we should use. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Be smarter about selecting wantsCarlos Martín Nieto2011-08-181-28/+2
| | | | | | | There is no need to inspect what the local repository is like. Only check whether the objects exist locally. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Remove enum git_whnCarlos Martín Nieto2011-08-181-14/+2
| | | | | | Instead, use flags inside the git_remote_head structure. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Only wait for pack if we need itCarlos Martín Nieto2011-08-181-4/+9
| | | | | | | Provide the git_remote_download function to instruct the library to downlad the packfile and let the user know the temporary location. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Tell the user where the downloaded packfile is storedCarlos Martín Nieto2011-08-181-2/+2
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Don't expose the fetch code to the userCarlos Martín Nieto2011-08-181-9/+11
| | | | | | | | Move the generation of the want-list to be done from the negotiate function, and keep the filtered references inside the remote structure. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Bind the configuration and remotes to a repositoryCarlos Martín Nieto2011-08-181-4/+6
| | | | | | | | Configurations when taken from a repository and remotes should be identifiable as coming from a particular repository. This allows us to reduce the amount of variables that the user has to keep track of. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Download packCarlos Martín Nieto2011-08-181-24/+8
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move have sendingCarlos Martín Nieto2011-08-181-18/+39
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Implement sending havesCarlos Martín Nieto2011-08-181-5/+5
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Add a generic send_wantsCarlos Martín Nieto2011-08-181-2/+5
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* negotiationCarlos Martín Nieto2011-08-181-3/+73
|
* Add git_fetch_list_want which creates the "want" listCarlos Martín Nieto2011-08-181-0/+123
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>