aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
Commit message (Collapse)AuthorAgeFilesLines
* Remote.Fetch: support exact SHA1 refspecsMáximo Cuadros2020-05-111-1/+32
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-17/+17
|
* *: fixed tautological error conditionsautological error conditionsChristian Muehlhaeuser2019-07-291-1/+1
| | | | | | | | | | - Added missing error handling around encodeCommitData and prevented shadowing err. - Removed tautological error checks. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit 7d76176416551fc21d98bc17768d158a82281406)
* Merge pull request #1165 from seletskiy/push-pruneMáximo Cuadros2019-07-261-15/+52
|\ | | | | Remote: add Prune option to PushOptions
| * send PACK only if non-delete command presentStanislav Seletskiy2019-07-251-10/+26
| | | | | | | | | | | | | | | | | | According to: https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt > The packfile MUST NOT be sent if the only command used is 'delete'. Signed-off-by: Stanislav Seletskiy <s.seletskiy@gmail.com>
| * add Prune option to PushOptionsStanislav Seletskiy2019-07-251-5/+26
| | | | | | | | Signed-off-by: Stanislav Seletskiy <s.seletskiy@gmail.com>
* | git : allows to create a Remote without a RepositoryValentin Cocaud2019-06-171-1/+4
|/ | | | Signed-off-by: Valentin Cocaud <v.cocaud@gmail.com>
* git: fix goroutine block while pushing a remoteJavi Fontan2019-03-011-1/+8
| | | | | | | | | On session.ReceivePack error the gororutine doing the encoding got blocked either writing objects to the pipe or sending error to the done channel. The problem did not cause a perceived problem but left blocked goroutines. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* remote: when pushing to a local repo, use local store for ignoresJeremy Stribling2019-02-111-1/+14
| | | | | Issue: #909 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* remote: use reference deltas on push when the remote server does notBenjamin Ash2018-10-161-2/+7
| | | | | | support offset deltas Signed-off-by: Benjamin Ash <bash@intelerad.com>
* Fixed cloning of a single tagFedor Korotkov2018-08-081-2/+2
| | | | | | Relates to #870 Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* Remote.Fetch: error on missing remote referenceMáximo Cuadros2018-06-211-5/+35
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* git: remote, Do not iterate all references on update.Javi Fontan2018-05-141-2/+22
| | | | | | | | | | | | | | | | | The current code iterates all the references in the remote to check if they match the refspec. This is OK when the refspec is a wildcard but is a waste of time when they are not. A hash with references is generated for fast access before starting the update and used only when the refspec is not a wildcard. In a repository with 7800 references this meant 7800 * 7800 checks. With the current code it took 8m30s to update the references. With the new code it takes less than 0.5s. References are already extensively tested in remote_test.go. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* git: remote, Add shallow commits instead of substituting. Fixes #412Javi Fontan2018-04-161-2/+17
| | | | | | | | | | updateShallow substituted the previous shallow list with the one returned by the UploadPackResponse. If the repository had previous shallow commits these are deleted from the list. This change adds the new shallow hashes to the old ones. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-271-6/+6
| | | | | | | | Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* remove unused result parameter from objectsToPushDaniel Martí2018-03-011-7/+3
| | | | | | It always returns a nil error. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
* all: simplificationferhat elmas2017-11-291-2/+2
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* Fetch - honor per refspec force flagTaru Karttunen2017-11-271-1/+1
|
* Use optionally locking when updating refsTaru Karttunen2017-11-271-1/+1
|
* Support non-force fetchesNick Thomas2017-11-271-2/+26
|
* all: fixes for ineffective assignferhat elmas2017-11-261-1/+2
|
* *: add pointer to the new transport.Endpoint structMáximo Cuadros2017-11-211-1/+1
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Merge pull request #641 from sunfishgao/patch-1Ori Rawlings2017-11-131-0/+1
|\ | | | | fix: a range loop can break in advance
| * fix: a range loop can break in advanceSunfish2017-11-131-0/+1
| |
* | remote: add the last 100 commits for each ref in haves listJeremy Stribling2017-10-051-3/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | If the local ref is not an ancestor of the remote ref being fetched, then when we send an UploadPack request with that local ref as one of the Haves, the remote will not recognize it, and will think we are asking for the entire history of the repo, even if there's a common ancestor. To do this right, we need to support the multi-ack protocol so we can negotiate a common commit. That's hard though; this is a quick fix just to include the previous 100 commits for each local ref in the Haves list, and hope that one of them is the common commit.
* | Merge pull request #609 from darkowlzz/ls-remoteMáximo Cuadros2017-10-041-0/+33
|\ \ | | | | | | remote: add support for ls-remote
| * | Create ListOptions and rename LSRemote to List.Sunny2017-10-041-3/+3
| | |
| * | remote: add support for ls-remoteSunny2017-10-021-0/+33
| |/
* | Merge pull request #586 from keybase/strib/commit-preorder-seen-gh-masterMáximo Cuadros2017-09-121-1/+1
|\ \ | | | | | | plumbing: the commit walker can skip externally-seen commits
| * | plumbing: the commit walker can skip externally-seen commitsJeremy Stribling2017-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the revlist is computing the set of hashes needed to transfer, it doesn't need to walk over commits it has already processed. So, it can instruct the commit walker not to walk those commits by passing in its own `seen` map. For a 36K object repo, this brought the time for `revlist.Objects` down from 50s to 30s.
* | | config: support a configurable, and turn-off-able, pack.windowJeremy Stribling2017-09-111-3/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One use of go-git is to transfer git data from a non-standard git repo (not stored in a file system, for example) to a "remote" backed by a standard, local .git repo. In this scenario, delta compression is not needed to reduce transfer time over the "network", because there is no network. The underlying storage layer has already taken care of the data tranfer, and sending the objects to local .git storage doesn't require compression. So this PR gives the user the option to turn off compression when it isn't needed. Of course, this results in a larger, uncompressed local .git repo, but the user can then run git gc or git repack on that repo if they care about the storage costs. Turning the pack window to 0 on reduces total push time of a 36K repo by 50 seconds (out of a pre-PR total of 3m26s).
* / remote: iterate over reference only onceMiguel Molina2017-09-051-27/+58
|/ | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* Remote.Fetch Tags logic improvement and fix NoTagsMáximo Cuadros2017-09-041-6/+16
|
* Add sideband support for pushOri Rawlings2017-09-011-4/+21
|
* remote: avoid expensive revlist operation when only deleting refsJeremy Stribling2017-08-281-3/+12
|
* Merge pull request #531 from mcuadros/ref-nameMáximo Cuadros2017-08-021-2/+2
|\ | | | | plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
| * *: use the new API for ReferenceName.Is* methodsMáximo Cuadros2017-08-021-2/+2
| |
* | config: multiple values in RemoteConfig (URLs and Fetch)Santiago M. Mola2017-08-011-4/+7
|/ | | | | | | | * Change `URL string` to `URL []string` in `RemoteConfig`, since git allows multiple URLs per remote. See: http://marc.info/?l=git&m=116231242118202&w=2 * Fix marshalling of multiple fetch refspecs.
* *: package context support in Repository, Remote and SubmoduleMáximo Cuadros2017-07-261-12/+43
|
* Merge pull request #507 from mcuadros/ctxMáximo Cuadros2017-07-251-2/+3
|\ | | | | transport: context package support allowing cancellation of any network operation
| * *: context.TODO()Máximo Cuadros2017-07-251-2/+3
| |
* | remote: push, update remote refs on pushMáximo Cuadros2017-07-221-15/+42
|/
* repository: allow push from shallow repositoriesMáximo Cuadros2017-07-191-1/+11
|
* Merge pull request #485 from mcuadros/fetch-tagsv4.0.0-rc12Máximo Cuadros2017-07-171-56/+83
|\ | | | | remote: fetch, correct behavior on tags
| * remote: fetch, correct behaviour on tagsMáximo Cuadros2017-07-171-56/+83
| |
* | remote: avoid duplicate havesMáximo Cuadros2017-07-131-3/+13
|/
* improve delete support on pushSantiago M. Mola2017-07-111-4/+18
| | | | | | | | | | | | | | | | | | | | | | | * server: implement delete-refs and announce it. * remote: check if server announced delete-refs before trying to delete and fail fast if it does not. Note that the client does not need no send 'delete-refs' back to the server to be able to delete references: ``` delete-refs ----------- If the server sends back the 'delete-refs' capability, it means that it is capable of accepting a zero-id value as the target value of a reference update. It is not sent back by the client, it simply informs the client that it can be sent zero-id values to delete references. ``` So our server implementation does not check if the client sent delete-refs back, it just accepts deletes if it receives them.
* remote: fix push delete, closes #466Santiago M. Mola2017-07-071-12/+48
| | | | | Refspecs for deletes were not being used to produce delete commands on the update request.
* Update local remote references during fetch even if no pack needs to be receivedOri Rawlings2017-06-191-25/+45
|
* Merge pull request #421 from smola/iter-namingMáximo Cuadros2017-06-141-1/+1
|\ | | | | fix naming of NewCommit{Pre,Post}Iterator