aboutsummaryrefslogtreecommitdiffstats
path: root/remote_test.go
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-261-2/+47
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* add RequireRemoteRefs to PushOptions (#258)Andrew Suffield2021-03-251-0/+53
| | | | | | | | | | | | | | | | | | The git protocol itself uses a compare-and-swap mechanism, where changes send the old and new values and the change is only applied if the old value matches. This is used to implement the --force-with-lease feature in git push. go-git populates the `old` field with the current value of the ref that is read from the remote. We can implement a convenient (albeit more limited) form of the --force-with-lease feature just by allowing the caller to specify particular values for this ref. Callers can then implement complex multi-step atomic operations by reading the ref themselves at the start of the process, and passing to in RequireRemoteRefs at the end. This is also a suitable building block for implementing --force-with-lease (#101), which is mostly an exercise in computing the correct hash to require. Hence, this appears to be the most reasonable API to expose.
* Fetch should return a unique error type when ref not foundandrew2nelson2020-09-021-0/+2
| | | | | | | | | It can be useful for callers to distinguish between an error of "couldn't find remote ref" and some other error like "network error". Creating an explicit error type for this allows consumers to determine the kind of error using the errors.Is and errors.As interface added in go1.13
* git: remote, Fix deleting references when force pushing.Chris Gavin2020-08-281-0/+25
|
* Remote.Push: support force optionkappyhappy2020-05-211-0/+28
|
* Remote.Fetch: support exact SHA1 refspecsMáximo Cuadros2020-05-111-1/+30
|
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-101-1/+1
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-11/+11
|
* Merge pull request #1165 from seletskiy/push-pruneMáximo Cuadros2019-07-261-1/+58
|\ | | | | Remote: add Prune option to PushOptions
| * add Prune option to PushOptionsStanislav Seletskiy2019-07-251-1/+58
| | | | | | | | Signed-off-by: Stanislav Seletskiy <s.seletskiy@gmail.com>
* | git : allows to create a Remote without a RepositoryValentin Cocaud2019-06-171-32/+32
|/ | | | Signed-off-by: Valentin Cocaud <v.cocaud@gmail.com>
* git: fix goroutine block while pushing a remoteJavi Fontan2019-03-011-0/+9
| | | | | | | | | 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: use reference deltas on push when the remote server does notBenjamin Ash2018-10-161-0/+23
| | | | | | support offset deltas Signed-off-by: Benjamin Ash <bash@intelerad.com>
* Expose Storage cache.kuba--2018-09-071-22/+13
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* Remote.Fetch: error on missing remote referenceMáximo Cuadros2018-06-211-0/+14
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* git: remote, Add shallow commits instead of substituting. Fixes #412Javi Fontan2018-04-161-0/+52
| | | | | | | | | | 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>
* dotgit: add CheckAndSetReference testsJeremy Stribling2017-11-281-2/+19
|
* remote: add test for non-force, fast-forward fetchingJeremy Stribling2017-11-271-0/+42
|
* all: fixes for ineffective assignferhat elmas2017-11-261-0/+3
|
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-2/+2
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* remote: add the last 100 commits for each ref in haves listJeremy Stribling2017-10-051-1/+5
| | | | | | | | | | | | | 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/+31
|\ | | | | remote: add support for ls-remote
| * TestList: explicitly check the refs in fixtureSunny2017-10-041-27/+21
| |
| * Create ListOptions and rename LSRemote to List.Sunny2017-10-041-5/+3
| |
| * remote: add support for ls-remoteSunny2017-10-021-0/+39
| |
* | remote: iterate over reference only onceMiguel Molina2017-09-051-13/+15
|/ | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* Remote.Fetch Tags logic improvement and fix NoTagsMáximo Cuadros2017-09-041-1/+1
|
* remote: avoid expensive revlist operation when only deleting refsJeremy Stribling2017-08-281-0/+36
|
* Merge pull request #531 from mcuadros/ref-nameMáximo Cuadros2017-08-021-1/+1
|\ | | | | plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
| * *: use the new API for ReferenceName.Is* methodsMáximo Cuadros2017-08-021-1/+1
| |
* | config: multiple values in RemoteConfig (URLs and Fetch)Santiago M. Mola2017-08-011-28/+27
|/ | | | | | | | * 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-0/+41
|
* Merge pull request #498 from mcuadros/fix-pushMáximo Cuadros2017-07-241-115/+75
|\ | | | | remote: push, update remote refs on push
| * remote: push, update remote refs on pushMáximo Cuadros2017-07-221-115/+75
| |
* | Implement a NoTags mode for fetch that mimics git fetch --no-tagsNick Thomas2017-07-221-0/+16
|/
* Merge pull request #485 from mcuadros/fetch-tagsv4.0.0-rc12Máximo Cuadros2017-07-171-53/+107
|\ | | | | remote: fetch, correct behavior on tags
| * remote: fetch, correct behaviour on tagsMáximo Cuadros2017-07-171-53/+107
| |
* | remote: avoid duplicate havesMáximo Cuadros2017-07-131-0/+19
|/
* remote: fix push delete, closes #466Santiago M. Mola2017-07-071-0/+47
| | | | | 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-0/+24
|
* *: upgrade to go-billy.v3, mergeMáximo Cuadros2017-06-181-7/+7
|
* do not convert local paths to URLSantiago M. Mola2017-04-281-15/+14
| | | | | | | * Do not convert local paths to URLs, just keep them as they are. * This way we add support for Windows without taking care of Windows path-to-URL conversion.
* add test for tags push, closes #354Santiago M. Mola2017-04-271-0/+45
|
* support force push (refspec with +)Santiago M. Mola2017-04-271-0/+87
| | | | | * add support for force push * add support for push of new references
* use go-billy.v2 versionAntonio Jesus Navarro Perez2017-03-101-1/+1
|
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-7/+7
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* submodule init implementationMáximo Cuadros2017-02-121-1/+2
|
* config: RefSpec.Validate returning errors and doc (Fixes #232)Máximo Cuadros2017-01-311-4/+4
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-301-5/+5
|
* new git fixture pathMáximo Cuadros2017-01-301-1/+1
|