• Bo Yang's avatar
    Refactor parse_loc · 25ed3412
    Bo Yang authored
    We want to use the same style of -L n,m argument for 'git log -L' as
    for git-blame.  Refactor the argument parsing of the range arguments
    from builtin/blame.c to the (new) file that will hold the 'git log -L'
    logic.
    
    To accommodate different data structures in blame and log -L, the file
    contents are abstracted away; parse_range_arg takes a callback that it
    uses to get the contents of a line of the (notional) file.
    
    The new test is for a case that made me pause during debugging: the
    'blame -L with invalid end' test was the only one that noticed an
    outright failure to parse the end *at all*.  So make a more explicit
    test for that.
    Signed-off-by: default avatarBo Yang <struggleyb.nku@gmail.com>
    Signed-off-by: default avatarThomas Rast <trast@student.ethz.ch>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    25ed3412
line-range.c 1.99 KB