diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2016-02-16 10:47:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-16 13:33:12 -0800 |
commit | cc8e538d45e4260b27196c3238e6f15d64236523 (patch) | |
tree | 2e0bafd5cb169ddadc64c72c25152c6e6118f970 /contrib/gitview | |
parent | remote: simplify remote_is_configured() (diff) | |
download | tgif-cc8e538d45e4260b27196c3238e6f15d64236523.tar.xz |
remote: actually check if remote exits
When converting the git remote command to a builtin in 211c89 ("Make
git-remote a builtin"), a few calls to check if a remote exists were
converted from:
if (!exists $remote->{$name}) {
[...]
to:
remote = remote_get(argv[1]);
if (!remote)
[...]
The new check is not quite correct, because remote_get() never returns
NULL if a name is given. This leaves us with the somewhat cryptic error
message "error: Could not remove config section 'remote.test'", if we
are trying to remove a remote that does not exist, or a similar error if
we try to rename a remote.
Use the remote_is_configured() function to check whether the remote
actually exists, and die with a more sensible error message ("No such
remote: $remotename") instead if it doesn't.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/gitview')
0 files changed, 0 insertions, 0 deletions