-
Notifications
You must be signed in to change notification settings - Fork 187
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
Prevent panic when cloning empty git repository #1021
Conversation
This actually does the right thing but was not taken into account while updating the package, as code doc clearly states:
|
b054fbd
to
c8fdc36
Compare
c8fdc36
to
2f69bf0
Compare
This covers the edge case in which a user creates a GitRepository CR referencing an empty Git repository. Currently, the controller will panic in this situation since the returned commit pointer is nil. Signed-off-by: Aurel Canciu <[email protected]>
2f69bf0
to
14a4a5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks.
Based on fluxcd/pkg#393 (comment), if and when the git package is updated, we can update the fix to adapt to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for @darkowlzz comment
Thanks @relu 🙇
i did not just spend 6 hours syncing with the wrong remote 🥲 |
This covers the edge case in which a user creates a GitRepository CR referencing an empty Git repository. Currently, the controller will panic in this situation since the returned commit pointer is nil.