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

Use libgit2 for clone, fetch, push #177

Merged
merged 2 commits into from
Jun 2, 2021
Merged

Conversation

squaremo
Copy link
Member

@squaremo squaremo commented Jun 2, 2021

source-controller/pkg/git does shallow clones when using the go-git
implementation, and apparently this causes problems when fetching a
branch that has been merged at the origin:

https:/fluxcd/image-automation-controller/issues/164

So far as I can tell, getting a shallow clone breaks the automation,
no matter whether go-git or libgit2 is used for operations after
cloning. So: just use libgit2 for cloning, which means non-shallow
clones; and, for fetch and push, since there's no functional
difference between the implementations for those.

Fixes #164.

  • alter docs to make it clear that the git implementation is ignored

@squaremo squaremo force-pushed the commit-to-merged-branch branch 2 times, most recently from f27be39 to b0d367e Compare June 2, 2021 13:55
source-controller/pkg/git does shallow clones when using the go-git
implementation, and apparently this causes problems when fetching a
branch that has been merged at the origin:

    #164

So far as I can tell, getting a shallow clone breaks the automation,
no matter whether go-git or libgit2 is used for operations after
cloning. So: just use libgit2 for cloning, which means non-shallow
clones; and, for fetch and push, since there's no functional
difference between the implementations for those.

Signed-off-by: Michael Bridgen <[email protected]>
The implementation is now ignored, in favour of just using libgit2.

Signed-off-by: Michael Bridgen <[email protected]>
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

This should solve #176 as we no longer use go-git for push operations.

Thanks @squaremo 🥇

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.

Merged but not deleted push branch halts automation
3 participants