| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new PeelingOption field was introduced into ListOptions. The new options
include the default (and backwards compatible) IgnorePeeled. Plus another
two variations which either only returns peeled references (OnlyPeeled), or
append peeled references to the list (AppendPeeled).
The ls-remote example was updated to align with upstream, in which peeled
references are appended to the results by default.
A new ErrEmptyUrls error is now returned when List or ListContext do not
receive a URL to work with, to improve overall execution flow.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
|
|
| |
The previous approach was intermittently flake, leading to different
results based on external results.
The check for goroutines numbers now checks for less or equal, as the
goal of the assertion is to confirm no goroutine is being leaked.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|\
| |
| | |
Remove unused vars/types/funcs/fields
|
| |
| |
| |
| |
| |
| |
| |
| | |
[staticcheck](https://staticcheck.io/) reported a number of unused
fields, functions, types, and variables across the code.
Where possible, use them (assert unchecked errors in tests, for example)
and otherwise remove them.
|
|/
|
|
|
|
|
|
| |
--force-with-lease allows a push to force push with some safety
measures. If the ref on the remote is what we expect, then the force
push is allowed to happen.
See https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt
for more information
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using plain git, the command `git push ${sha}:refs/heads/some-branch`
actually ensures that the remote branch `some-branch` points to the
commit `${sha}`.
In the current version of go-git, this results in an "everything is
up to date" error.
When a source reference is not found, check the object storage to find
the sha. If it is found, consider pushing this exact commit.
fixes: #105
|
|\
| |
| | |
Remote: add RemoteURL to {Fetch,Pull,Push}Options
|
| | |
|
|/
|
|
| |
This PR adds support for the --follow-tags option for pushes.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* plumbing: wire up contexts for Transport.AdvertisedReferences
* add more tests for context wiring
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Remote: add Prune option to PushOptions
|
| |
| |
| |
| | |
Signed-off-by: Stanislav Seletskiy <s.seletskiy@gmail.com>
|
|/
|
|
| |
Signed-off-by: Valentin Cocaud <v.cocaud@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
support offset deltas
Signed-off-by: Benjamin Ash <bash@intelerad.com>
|
|
|
|
| |
Signed-off-by: kuba-- <kuba@sourced.tech>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
remote: add support for ls-remote
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
|
| |
|
| |
|
|\
| |
| | |
plumbing: moved `Reference.Is*` methods to `ReferenceName.Is*`
|
| | |
|
|/
|
|
|
|
|
|
| |
* 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.
|
| |
|
|\
| |
| | |
remote: push, update remote refs on push
|
| | |
|
|/ |
|
|\
| |
| | |
remote: fetch, correct behavior on tags
|
| | |
|
|/ |
|