Re: [PATCH 04/45] pathspec: add copy_pathspec
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 9, 2013, 07:58 UTC
- Message-ID
- <CAPig+cTP8HuPzp=THuSTFtRW8uNgqxROWuQUG7_bYC_FSs5rpQ@mail.gmail.com>
- In-Reply-To
- <1370759178-1709-5-git-send-email-pclouds@gmail.com>
On Sun, Jun 9, 2013 at 2:25 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> The function is made to use with free_pathspec() because a simple > struct assignment is not enough (free_pathspec wants to free "items" > pointer).
I had to read this about five or six times before I could parse and understand it. Perhaps rewrite something like this:
free_pathspec() frees pathspec->items, hence simple struct
assignment does not properly duplicate a pathspec. Introduce
copy_pathspec() to clone a pathspec correctly by deeply copying
the items member.> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>