Skip to content
  • Thomas Gummerer's avatar
    remote: simplify remote_is_configured() · 674468b3
    Thomas Gummerer authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The remote_is_configured() function allows checking whether a remote
    exists or not.  The function however only works if remote_get() wasn't
    called before calling it.  In addition, it only checks the configuration
    for remotes, but not remotes or branches files.
    
    Make use of the origin member of struct remote instead, which indicates
    where the remote comes from.  It will be set to some value if the remote
    is configured in any file in the repository, but is initialized to 0 if
    the remote is only created in make_remote().
    
    Signed-off-by: default avatarThomas Gummerer <t.gummerer@gmail.com>
    Reviewed-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    674468b3