| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
--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
|
|\
| |
| | |
Remote: PushOptions add push-options
|
| |
| |
| |
| | |
go-git: Add field `Options` to `PushOptions`, wire functionality.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
| |
| |
| |
| | |
Can be used to override the URL to operate on:
RemoteName will be ignored for the actual fetch
|
|/
|
|
| |
This PR adds support for the --follow-tags option for pushes.
|
|
|
| |
It looks a test value was shipped breaking a lot of the usage of the library.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
This PR add insecureSkipTLSVerify and cabundle to any remote http calls
so that https repo with private CA signed can be used. This is the
equivalent of https.sslVerify and GIT_SSL_CAINFO
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|\
| |
| | |
*: minor linter fixes
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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)
|
|\
| |
| | |
Remote: add Prune option to PushOptions
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
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>
|
|
|
|
|
| |
Issue: #909
Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
|
|
|
|
|
|
| |
support offset deltas
Signed-off-by: Benjamin Ash <bash@intelerad.com>
|
|
|
|
|
|
| |
Relates to #870
Signed-off-by: Fedor Korotkov <fedor.korotkov@gmail.com>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
It always returns a nil error.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
|
|
|
|
|
|
|
|
|
|
| |
- 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`
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|\
| |
| | |
fix: a range loop can break in advance
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | | |
|
| |/ |
|