-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Unset or empty remote URL behavior does not match with git CLI #7028
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
Comments
Well that's just fucking horrifying. But thanks for the report. |
Well, this is going to be fun. My git (v2.45.3) doesn't quite behave this way.
gives no remote:
but when the
|
Oh weird! Sorry, I should have noted the git version I was running (2.47.0). I believe this changed in 2.46.0 via git/git@9badf97. I can't really tell if this is intentional behavior. BTW, I noticed your GitHub ISSUE_TEMPLATE isn't working. I dunno if being a file was some legacy thing that doesn't work with the new GitHub Issues, but it looks like they want that to be a directory now with files inside it. |
Interesting! That's helpful. I... can't tell either, but as I often bemoan, we try to be bug-for-bug compatible. |
The behavior when a remote's URL is either the empty string, or not set, does not match with the git CLI. If the url is empty or not set, then the CLI uses the remote's name as the URL. I think this is implemented here if you are curious.
Currently, when the url is the empty string,
git_remote_url
returns NULL. At a minimum, I think it would be good to document that.If the url is not set, then you get an error loading the remote.
For example, if you have this remote config:
then
git_remote_url
will return NULL for that remote, whereasgit remote get-url foo
will printfoo
, andgit fetch foo
is also able to fetch fromfoo
if it is a relative path.The text was updated successfully, but these errors were encountered: