diff options
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pathspec.c b/pathspec.c index 403095ba8c..8fe56cd8e9 100644 --- a/pathspec.c +++ b/pathspec.c @@ -249,3 +249,11 @@ const char **get_pathspec(const char *prefix, const char **pathspec) return NULL; return pathspec; } + +void copy_pathspec(struct pathspec *dst, const struct pathspec *src) +{ + *dst = *src; + dst->items = xmalloc(sizeof(struct pathspec_item) * dst->nr); + memcpy(dst->items, src->items, + sizeof(struct pathspec_item) * dst->nr); +} |