Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libgit2 to 1.3.0 #321

Merged
merged 5 commits into from
Mar 2, 2022
Merged

Update libgit2 to 1.3.0 #321

merged 5 commits into from
Mar 2, 2022

Conversation

pjbgf
Copy link
Member

@pjbgf pjbgf commented Feb 22, 2022

Update source controller to v0.21.3 (fluxcd/source-controller#589) and update libgit2 to v1.3.0.

Fixes #320

@pjbgf pjbgf marked this pull request as draft February 22, 2022 13:30
@pjbgf pjbgf force-pushed the libgit2-130 branch 4 times, most recently from d811077 to f618292 Compare February 23, 2022 13:43
@pjbgf pjbgf requested a review from hiddeco February 23, 2022 13:43
@pjbgf pjbgf marked this pull request as ready for review February 23, 2022 13:43
@pjbgf pjbgf requested a review from darkowlzz February 23, 2022 13:43
@@ -1413,3 +1435,77 @@ func mergeBranchIntoHead(repo *git.Repository, pushBranch string) {
})
Expect(err).NotTo(HaveOccurred())
}

// copied from source-controller/pkg/git/libgit2/checkout.go
func commitFile(repo *git2go.Repository, path, content string, time time.Time) (*git2go.Oid, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rewrite the commit logic using libgit2

func commitChangedManifests(tracelog logr.Logger, repo *gogit.Repository, absRepoPath string, ent *openpgp.Entity, author *object.Signature, message string) (string, error) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote the gitInitRepo with libgit2, which was enough to remove the need for the adhoc fix.

Can we go ahead with the libgit2 to 1.3.0 on this PR and then any further rewrite/replacement of go-git we can deal on a separate PR.

@pjbgf pjbgf force-pushed the libgit2-130 branch 2 times, most recently from 9d0de93 to bc4a4e0 Compare March 1, 2022 13:29
@pjbgf pjbgf requested a review from stefanprodan March 1, 2022 13:54
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @pjbgf

@pjbgf pjbgf merged commit 121577c into fluxcd:main Mar 2, 2022
@pjbgf pjbgf deleted the libgit2-130 branch March 2, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update libgit2 to 1.3.0
2 participants