Skip to content

[packager] Improve error message when branch could not be created#916

Merged
simoncozens merged 1 commit intomainfrom
message-on-no-branch
Apr 18, 2024
Merged

[packager] Improve error message when branch could not be created#916
simoncozens merged 1 commit intomainfrom
message-on-no-branch

Conversation

@simoncozens
Copy link
Contributor

If the git branch command failed for any reason, you would get the error 'NoneType' object has no attribute 'name' when the code tried to use the (None) branch variable. This gives you the output from git.

@simoncozens simoncozens marked this pull request as ready for review April 10, 2024 12:44
@m4rc1e
Copy link
Collaborator

m4rc1e commented Apr 10, 2024

Looks good. However, I'm interested in understanding why it wasn't able to create the branch?

@simoncozens simoncozens merged commit 6e70aed into main Apr 18, 2024
@simoncozens
Copy link
Contributor Author

I've worked out why this was failing for me: I have git configured to pull with rebase instead of merge, to avoid needless merges. But that only works if the working tree is clean. _create_git_branch does a git pull --force but we are guaranteed to have a dirty working tree as we've just been editing a METADATA.pb file in there. So the git pull fails.

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.

2 participants