Skip to content
  • Isabella Stephens's avatar
    blame: prevent error if range ends past end of file · 96cfa94e
    Isabella Stephens authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    If the -L option is used to specify a line range in git blame, and the
    end of the range is past the end of the file, git will fail with a fatal
    error. This commit prevents such behavior - instead we display the blame
    for existing lines within the specified range. Tests are amended
    accordingly.
    
    This commit also fixes two corner cases. Blaming -L n,-(n+1) now blames
    the first n lines of a file rather than from n to the end of the file.
    Blaming -L ,-n will be treated as -L 1,-n and blame the first line of
    the file, rather than blaming the whole file.
    
    Signed-off-by: default avatarIsabella Stephens <istephens@atlassian.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    96cfa94e