| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Decreases allocations and bytes per operation by using string builder
with a predefined size.
One additional allocation has been removed by using its own implementation
of Strings(). The reason behind this was due to the fact the calls to
.String() are more recurrent than .Strings() and the performance impact
was worth the code duplication.
Benchmark results:
cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
name old time/op new time/op delta
ReferenceStringSymbolic-16 140ns ± 4% 40ns ± 9% -71.19% (p=0.008 n=5+5)
ReferenceStringHash-16 174ns ±14% 85ns ± 4% -51.13% (p=0.008 n=5+5)
ReferenceStringInvalid-16 48.9ns ± 2% 1.5ns ± 3% -96.96% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
ReferenceStringSymbolic-16 88.0B ± 0% 32.0B ± 0% -63.64% (p=0.008 n=5+5)
ReferenceStringHash-16 176B ± 0% 144B ± 0% -18.18% (p=0.008 n=5+5)
ReferenceStringInvalid-16 0.00B 0.00B ~ (all equal)
name old allocs/op new allocs/op delta
ReferenceStringSymbolic-16 4.00 ± 0% 1.00 ± 0% -75.00% (p=0.008 n=5+5)
ReferenceStringHash-16 5.00 ± 0% 3.00 ± 0% -40.00% (p=0.008 n=5+5)
ReferenceStringInvalid-16 0.00 0.00 ~ (all equal)
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
| |
|
|
|
|
|
| |
Signed-off-by: cui fliter <imcusg@gmail.com>
Signed-off-by: cui fliter <imcusg@gmail.com>
|
| |
|
|
|
|
| |
`GO_GIT_USER_AGENT_EXTRA` as the git user agent. Fixes #529
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#411
This commit adjusts the transport/ssh logic in command.connect(), so that it
now auto-populates ssh.ClientConfig.HostKeyAlgorithms. The algorithms are
chosen based on the known host keys for the target host, as obtained from the
known_hosts file.
In order to look-up the algorithms from the known_hosts file, external module
github.com/skeema/knownhosts is used. This package is just a thin wrapper
around golang.org/x/crypto/ssh/knownhosts, adding an extra mechanism to query
the known_hosts keys, implemented in a way which avoids duplication of any
golang.org/x/crypto/ssh/knownhosts logic.
Because HostKeyAlgorithms vary by target host, some related logic for setting
HostKeyCallback has been moved out of the various AuthMethod implementations.
This was necessary because the old HostKeyCallbackHelper is not host-specific.
Since known_hosts handling isn't really tied to AuthMethod anyway, it seems
reasonable to separate these. Previously-exported types/methods remain in
place for backwards compat, but some of them are now unused.
For testing approach, see pull request. Issue #411 can only be reproduced
via end-to-end / integration testing, since it requires actually launching
an SSH connection, in order to see the key mismatch error triggered from
https://github.com/golang/go/issues/29286 as the root cause.
|
| |
|
|
|
|
| |
Added in Go 1.12, this means we need one less dependency.
|
|
|
|
|
|
|
|
|
| |
value. (#521)
Previously, calling `Set($CAPABILITY, ...)` on a `capability.List` where `$CAPABILITY`
was already present would correctly replace the existing value of that capability, but
would also result in that capability being listed twice in the internal `l.sort` slice.
This manifested publicly when the `List` was encoded as the same capability appearing
twice with the same value in the encoded output.
|
|
|
|
| |
Use the syscall method instead of repeating the type conversions for
the syscall.Stat_t Atim/Atimespec/Ctim members.
|
|\
| |
| | |
revision: fix endless looping in revision parser
|
|/
|
|
|
|
|
|
|
|
|
| |
Fixes a bug in the revision parser which caused an endless loop when
parsing revisions with opening braces "{" but no closing braces "}".
Example bad revisions:
- ^{/
- ~@{
- @@{{0
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When fs.Stat returns an error, pathinfo may be nil. In such situations
the only safe response seems to be to return the error to the caller.
Without this fix, accessing pathinfo.IsDir() below would lead to a crash
dereferencing a nil pointer.
This crash can be reproduced by trying to initialize a Git repo with an
invalid path name.
Also see: https://github.com/muesli/gitty/issues/36
|
|
|
| |
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
|
|\
| |
| | |
fix: resolve external reference delta
|
| | |
|
| |\ |
|
| | |\
| |_|/
|/| | |
|
|\ \ \
| | | |
| | | | |
error strings: Don't capitalize, use periods, or newlines
|
| | | |
| | | |
| | | |
| | | | |
The test verifies the exact error message.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Per [Go Code Review Comments][1],
> Error strings should not be capitalized (unless beginning with proper
> nouns or acronyms) or end with punctuation
staticcheck's [ST1005][2] also complains about these. For example,
```
object_walker.go:63:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not be capitalized (ST1005)
object_walker.go:101:10: error strings should not end with punctuation or a newline (ST1005)
plumbing/format/commitgraph/file.go:17:26: error strings should not be capitalized (ST1005)
```
This fixes all instances of this issue reported by staticcheck.
[1]: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
[2]: https://staticcheck.io/docs/checks/#ST1005
|
|\ \ \ \
| | | | |
| | | | | |
Remove unused vars/types/funcs/fields
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The membership check before attempting to `delete` from the `tags` map
is unnecessary because the operation is a no-op if the item does not
already exist in the map.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The packRefs field is unused.
It is assigned to true from the `PackRefs()` method,
but because the method is not on the pointer type,
the assignment has no effect.
var st ReferenceStorage
fmt.Println(st.packRefs) // false
st.PackRefs()
fmt.Println(st.packRefs) // false
Delete the unused field.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The `cfg` loaded from `cs.Config` was unused.
It looks like this assertion intended to validate that,
not `temporalCfg`, which was already checked above this block.
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
[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.
|
|\ \ \ \
| | | | |
| | | | | |
Remote: Push, add atomic to push options
|
| |\ \ \ \
| |/ / / /
|/| | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Worktree: Checkout, simplified sparse checkout
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is the initial logic to support a simple sparse checkout where
directories to be included can be specified in CheckoutOptions.
This change doesn't fully support the sparse patterns, nor does this
change include the optimization to collapse flie entries in ithe index
that are excluded via the sparse checkout directory patterns included
under the parent directory.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
config: add branch description support
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remote: Push, add ForceWithLease Push Option
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
--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
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
packp: Actions should have type Action
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Per the [Go Spec](https://go.dev/ref/spec#Constant_declarations),
the following yields the type `Action` for `Bar` and `Baz`
only if there is no `=`.
const (
Foo Action = ...
Bar
Baz
)
The following has the type `Action` for the first item,
but not the rest. Those are untyped constants
of the corresponding type.
const (
Foo Action = ...
Bar = ...
Baz = ...
)
This means that `packp.{Update, Delete, Invalid}` are currently
untyped string constants, and not `Action` constants
as was intended here.
This change fixes these.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The `os.SEEK_*` constants have been deprecated since Go 1.7.
It is now recommended to use the equivalent `io.Seek*` constants.
Switch `os.SEEK_CUR` to `io.SeekCurrent`,
and `os.SEEK_SET` to `io.SeekStart`.
|
|/ / / / / |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
plumbing: format, support v3 index
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently the index encoder does not support the v3 index format. This
change adds support to the encoder. This helps to unlock sparse
checkout.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
push --atomic allows a push to succeed or fail atomically. If one ref
fails, the whole push fails. This commit allows the user to set Atomic
as an option for a push.
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | | |
Remote: PushOptions add push-options
|
| | | |
| | | |
| | | |
| | | | |
go-git: Add field `Options` to `PushOptions`, wire functionality.
|