Skip to content

Commit f044ebc

Browse files
author
Philip Laine
committed
Rename git2go option to libgit2
Signed-off-by: Philip Laine <[email protected]>
1 parent 1b4eacc commit f044ebc

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

api/v1beta1/gitrepository_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const (
2929
// Represents the go-git git implementation kind
3030
GoGitImplementation = "go-git"
3131
// Represents the gi2go git implementation kind
32-
Git2GoImplementation = "git2go"
32+
LibGit2Implementation = "libgit2"
3333
)
3434

3535
// GitRepositorySpec defines the desired state of a Git repository.
@@ -76,8 +76,8 @@ type GitRepositorySpec struct {
7676
Suspend bool `json:"suspend,omitempty"`
7777

7878
// Determines which git client library to use.
79-
// Defaults to go-git, valid values are ('go-git', 'git2go').
80-
// +kubebuilder:validation:Enum=go-git;git2go
79+
// Defaults to go-git, valid values are ('go-git', 'libgit2').
80+
// +kubebuilder:validation:Enum=go-git;libgit2
8181
// +kubebuilder:default:=go-git
8282
// +optional
8383
GitImplementation string `json:"gitImplementation,omitempty"`

config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ spec:
5252
gitImplementation:
5353
default: go-git
5454
description: Determines which git client library to use. Defaults
55-
to go-git, valid values are ('go-git', 'git2go').
55+
to go-git, valid values are ('go-git', 'libgit2').
5656
enum:
5757
- go-git
58-
- git2go
58+
- libgit2
5959
type: string
6060
ignore:
6161
description: Ignore overrides the set of excluded patterns in the

controllers/gitrepository_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ var _ = Describe("GitRepositoryReconciler", func() {
321321
waitForReason: sourcev1.GitOperationFailedReason,
322322
expectStatus: metav1.ConditionFalse,
323323
expectMessage: "error: user rejected certificate",
324-
gitImplementation: sourcev1.Git2GoImplementation,
324+
gitImplementation: sourcev1.LibGit2Implementation,
325325
}),
326326
)
327327
})

docs/api/source.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ string
397397
<td>
398398
<em>(Optional)</em>
399399
<p>Determines which git client library to use.
400-
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;git2go&rsquo;).</p>
400+
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;libgit2&rsquo;).</p>
401401
</td>
402402
</tr>
403403
</table>
@@ -1243,7 +1243,7 @@ string
12431243
<td>
12441244
<em>(Optional)</em>
12451245
<p>Determines which git client library to use.
1246-
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;git2go&rsquo;).</p>
1246+
Defaults to go-git, valid values are (&lsquo;go-git&rsquo;, &lsquo;libgit2&rsquo;).</p>
12471247
</td>
12481248
</tr>
12491249
</tbody>

docs/spec/v1beta1/gitrepositories.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ type GitRepositorySpec struct {
5252
Suspend bool `json:"suspend,omitempty"`
5353

5454
// Determines which git client library to use.
55-
// Defaults to go-git, valid values are ('go-git', 'git2go').
56-
// +kubebuilder:validation:Enum=go-git;git2go
55+
// Defaults to go-git, valid values are ('go-git', 'libgit2').
56+
// +kubebuilder:validation:Enum=go-git;libgit2
5757
// +kubebuilder:default:=go-git
5858
// +optional
5959
GitImplementation string `json:"gitImplementation,omitempty"`
@@ -194,10 +194,10 @@ and also impact the traffic costs.
194194
To be able to support Azure DevOps a compromise solution was built, giving the user the
195195
option to select the git library while accepting the drawbacks.
196196

197-
| Git Implementation | Shallow Clones | Azure DevOps Support |
197+
| Git Implementation | Shallow Clones | V2 Protocol Support |
198198
|---|---|---|
199199
| 'go-git' | true | false |
200-
| 'git2go' | false | true |
200+
| 'libgit2' | false | true |
201201

202202
Pull the master branch from a repository in Azure DevOps.
203203

@@ -210,7 +210,7 @@ metadata:
210210
spec:
211211
interval: 1m
212212
url: https://dev.azure.com/org/proj/_git/repo
213-
gitImplementation: git2go
213+
gitImplementation: libgit2
214214
```
215215

216216
## Spec examples

pkg/git/git.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func CheckoutStrategyForRef(ref *sourcev1.GitRepositoryRef, gitImplementation st
3333
switch gitImplementation {
3434
case sourcev1.GoGitImplementation:
3535
return gitv1.CheckoutStrategyForRef(ref), nil
36-
case sourcev1.Git2GoImplementation:
36+
case sourcev1.LibGit2Implementation:
3737
return gitv2.CheckoutStrategyForRef(ref), nil
3838
default:
3939
return nil, fmt.Errorf("invalid git implementation %s", gitImplementation)
@@ -44,7 +44,7 @@ func AuthSecretStrategyForURL(url string, gitImplementation string) (common.Auth
4444
switch gitImplementation {
4545
case sourcev1.GoGitImplementation:
4646
return gitv1.AuthSecretStrategyForURL(url)
47-
case sourcev1.Git2GoImplementation:
47+
case sourcev1.LibGit2Implementation:
4848
return gitv2.AuthSecretStrategyForURL(url)
4949
default:
5050
return nil, fmt.Errorf("invalid git implementation %s", gitImplementation)

0 commit comments

Comments
 (0)