pathspec: add copy_pathspec
commite4d92cdcd9450af7ae4c40de2b7c5c27a1faa138
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 14 Jul 2013 08:35:27 +0000 (14 15:35 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:56:06 +0000 (15 10:56 -0700)
tree109ff87d743706a097a180954113e2036c79af03
parentf01d9820e768e7eb9eab4ad9a55a62317e0b23ad
pathspec: add copy_pathspec

Because free_pathspec wants to free "items" pointer in the pathspec
structure, a simple structure assignment is not enough if you want to
copy an existing pathspec into another.  Freeing the original will
damage the copy unless a deep copy is made.

Note that the strings in pathspec->items->match and the array
pathspec->raw[] are still shared between the original and the copy.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mv.c
pathspec.c
pathspec.h