Commit fd2ff8c9 by Patrick Steinhardt

remote: improve error message if no URL is set

The current error message when connecting to a remote when no URL is set
is missing information on whether it is missing a fetch or push URL.
Furthermore, it results in undefined behavior when using a remote
without name. Fix both issues.
parent 1b6ab16f
......@@ -674,7 +674,9 @@ int git_remote_connect(git_remote *remote, git_direction direction, const git_re
url = git_remote__urlfordirection(remote, direction);
if (url == NULL) {
giterr_set(GITERR_INVALID,
"Malformed remote '%s' - missing URL", remote->name);
"Malformed remote '%s' - missing %s URL",
remote->name ? remote->name : "(anonymous)",
direction == GIT_DIRECTION_FETCH ? "fetch" : "push");
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment