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

Fix missing origin repository bug #512

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

jo-basevi
Copy link
Collaborator

In #405, payu checkout raises an error when it is no longer able to fetch branches from the remote repository. This happens when cloning from a remote repository using a path, and then that path gets deleted at a later point of time.

I changed it to catch the exception, and to display a warning to the user instead that payu was not able to fetch from the remote repository.

@coveralls
Copy link

coveralls commented Sep 16, 2024

Coverage Status

coverage: 56.143% (+0.2%) from 55.914%
when pulling d7f9e50 on ACCESS-NRI:405-missing-origin-repository
into e59d400 on payu-org:master.

@jo-basevi jo-basevi self-assigned this Sep 16, 2024
@jo-basevi jo-basevi marked this pull request as ready for review September 16, 2024 23:20
@jo-basevi
Copy link
Collaborator Author

Closes #405

aidanheerdegen
aidanheerdegen previously approved these changes Sep 17, 2024
Copy link
Collaborator

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

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

LGTM, just a question as per usual.

payu/git_utils.py Show resolved Hide resolved
aidanheerdegen
aidanheerdegen previously approved these changes Sep 17, 2024
Copy link
Collaborator

@aidanheerdegen aidanheerdegen 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!

@jo-basevi
Copy link
Collaborator Author

jo-basevi commented Sep 17, 2024

Sorry I had a small spacing error! Though it did get me thinking whether it should still use that last saved changes from the remote repository (whether to remove the continue on the loop through remotes).. But if it can't fetch the latest updates it probably should not be able to checkout a remote branch? So maybe fine to leave as is

@aidanheerdegen aidanheerdegen self-requested a review September 17, 2024 04:54
Copy link
Collaborator

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

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

LGTM.

@aidanheerdegen
Copy link
Collaborator

Though it did get me thinking whether it should still use that last saved changes from the remote repository (whether to remove the continue on the loop through remotes).. But if it can't fetch the latest updates it probably should not be able to checkout a remote branch? So maybe fine to leave as is

Yeah I think that is the cleanest approach.

@jo-basevi jo-basevi merged commit 68d8482 into payu-org:master Sep 18, 2024
8 checks passed
@jo-basevi jo-basevi deleted the 405-missing-origin-repository branch September 18, 2024 00:31
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.

3 participants