path: root/pathspec.h
diff options
authorNguyễn Thái Ngọc Duy <>2013-07-14 08:35:27 (GMT)
committerJunio C Hamano <>2013-07-15 17:56:06 (GMT)
commite4d92cdcd9450af7ae4c40de2b7c5c27a1faa138 (patch)
tree109ff87d743706a097a180954113e2036c79af03 /pathspec.h
parentf01d9820e768e7eb9eab4ad9a55a62317e0b23ad (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pathspec.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/pathspec.h b/pathspec.h
index 7884068..a621676 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -18,6 +18,7 @@ struct pathspec {
extern int init_pathspec(struct pathspec *, const char **);
+extern void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
extern void free_pathspec(struct pathspec *);
extern int limit_pathspec_to_literal(void);