Skip to content
  • Junio C Hamano's avatar
    git-fetch: fail if specified refspec does not match remote. · 9e5d2b40
    Junio C Hamano authored
    
    
    'git-fetch remote no-such-ref' succeeded without fetching any
    ref from the remote.  Detect such case and report an error.
    
    Note that this makes 'git-fetch remote master master' to fail,
    because the remote branch 'master' matches the first refspec,
    and the second refspec is left unmatched, which is detected by
    the error checking logic.  This is somewhat unintuitive, but
    giving the same refspec more than once to git-fetch is useless
    in any case so it should not be much of a problem.  I'd accept a
    patch to change this if somebody cares enough, though.
    
    Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
    9e5d2b40