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

git: differentiate between no such branch and no such repo #18

Conversation

oliver-sanders
Copy link

No description provided.

@@ -166,6 +166,9 @@ def _get_commithash(self, remote, ref):
"""
ret_code, info, _ = self.manager.popen.run(
"git", "ls-remote", "--exit-code", remote, ref)
if ret_code == 128:
# repo not found
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for this 👍, nice change in principle.

I can't find any docs on 128 for ls-remote - the exit code documentation for Git appears to me to be a bit light.

2 is mentioned as = "no matching refs are found" . We could consider changing it to != 2?

Copy link
Author

@oliver-sanders oliver-sanders Jun 17, 2024

Choose a reason for hiding this comment

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

Good point, !=2 should be safer.

(done)

@benfitzpatrick benfitzpatrick merged commit ec5e917 into benfitzpatrick:1419.git_file_creation_loc_handler Jun 18, 2024
@oliver-sanders oliver-sanders deleted the git-no-such-repo branch June 18, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants