Skip to content
  • Thomas Rast's avatar
    read_revisions_from_stdin: make copies for handle_revision_arg · 70d26c6e
    Thomas Rast authored and Junio C Hamano's avatar Junio C Hamano committed
    read_revisions_from_stdin() has passed pointers to its read buffer
    down to handle_revision_arg() since its inception way back in 42cabc34
    
    
    (Teach rev-list an option to read revs from the standard input.,
    2006-09-05).  Even back then, this was a bug: through
    add_pending_object, the argument was recorded in the object_array's
    'name' field.
    
    Fix it by making a copy whenever read_revisions_from_stdin() passes an
    argument down the callchain.  The other caller runs handle_revision_arg()
    on argv[], where it would be redundant to make a copy.
    
    Signed-off-by: default avatarThomas Rast <trast@inf.ethz.ch>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    70d26c6e