Rename git2go option to libgit2

Signed-off-by: Philip Laine <philip.laine@xenit.se>
This commit is contained in:
Philip Laine 2020-12-06 23:19:53 +01:00
parent 1b4eacc588
commit f044ebc253
6 changed files with 15 additions and 15 deletions

View File

@ -29,7 +29,7 @@ const (
// Represents the go-git git implementation kind
GoGitImplementation = "go-git"
// Represents the gi2go git implementation kind
Git2GoImplementation = "git2go"
LibGit2Implementation = "libgit2"
)
// GitRepositorySpec defines the desired state of a Git repository.
@ -76,8 +76,8 @@ type GitRepositorySpec struct {
Suspend bool `json:"suspend,omitempty"`
// Determines which git client library to use.
// Defaults to go-git, valid values are ('go-git', 'git2go').
// +kubebuilder:validation:Enum=go-git;git2go
// Defaults to go-git, valid values are ('go-git', 'libgit2').
// +kubebuilder:validation:Enum=go-git;libgit2
// +kubebuilder:default:=go-git
// +optional
GitImplementation string `json:"gitImplementation,omitempty"`

View File

@ -52,10 +52,10 @@ spec:
gitImplementation:
default: go-git
description: Determines which git client library to use. Defaults
to go-git, valid values are ('go-git', 'git2go').
to go-git, valid values are ('go-git', 'libgit2').
enum:
- go-git
- git2go
- libgit2
type: string
ignore:
description: Ignore overrides the set of excluded patterns in the

View File

@ -321,7 +321,7 @@ var _ = Describe("GitRepositoryReconciler", func() {
waitForReason: sourcev1.GitOperationFailedReason,
expectStatus: metav1.ConditionFalse,
expectMessage: "error: user rejected certificate",
gitImplementation: sourcev1.Git2GoImplementation,
gitImplementation: sourcev1.LibGit2Implementation,
}),
)
})

View File

@ -397,7 +397,7 @@ string
<td>
<em>(Optional)</em>
<p>Determines which git client library to use.
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;git2go&rsquo;).</p>
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;libgit2&rsquo;).</p>
</td>
</tr>
</table>
@ -1243,7 +1243,7 @@ string
<td>
<em>(Optional)</em>
<p>Determines which git client library to use.
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;git2go&rsquo;).</p>
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;libgit2&rsquo;).</p>
</td>
</tr>
</tbody>

View File

@ -52,8 +52,8 @@ type GitRepositorySpec struct {
Suspend bool `json:"suspend,omitempty"`
// Determines which git client library to use.
// Defaults to go-git, valid values are ('go-git', 'git2go').
// +kubebuilder:validation:Enum=go-git;git2go
// Defaults to go-git, valid values are ('go-git', 'libgit2').
// +kubebuilder:validation:Enum=go-git;libgit2
// +kubebuilder:default:=go-git
// +optional
GitImplementation string `json:"gitImplementation,omitempty"`
@ -194,10 +194,10 @@ and also impact the traffic costs.
To be able to support Azure DevOps a compromise solution was built, giving the user the
option to select the git library while accepting the drawbacks.
| Git Implementation | Shallow Clones | Azure DevOps Support |
| Git Implementation | Shallow Clones | V2 Protocol Support |
|---|---|---|
| 'go-git' | true | false |
| 'git2go' | false | true |
| 'libgit2' | false | true |
Pull the master branch from a repository in Azure DevOps.
@ -210,7 +210,7 @@ metadata:
spec:
interval: 1m
url: https://dev.azure.com/org/proj/_git/repo
gitImplementation: git2go
gitImplementation: libgit2
```
## Spec examples

View File

@ -33,7 +33,7 @@ func CheckoutStrategyForRef(ref *sourcev1.GitRepositoryRef, gitImplementation st
switch gitImplementation {
case sourcev1.GoGitImplementation:
return gitv1.CheckoutStrategyForRef(ref), nil
case sourcev1.Git2GoImplementation:
case sourcev1.LibGit2Implementation:
return gitv2.CheckoutStrategyForRef(ref), nil
default:
return nil, fmt.Errorf("invalid git implementation %s", gitImplementation)
@ -44,7 +44,7 @@ func AuthSecretStrategyForURL(url string, gitImplementation string) (common.Auth
switch gitImplementation {
case sourcev1.GoGitImplementation:
return gitv1.AuthSecretStrategyForURL(url)
case sourcev1.Git2GoImplementation:
case sourcev1.LibGit2Implementation:
return gitv2.AuthSecretStrategyForURL(url)
default:
return nil, fmt.Errorf("invalid git implementation %s", gitImplementation)