diff --git a/builtin/checkout.c b/builtin/checkout.c
index 38632fc39805085e3b134e0574f3846931c150c6..4761769512a8abcdd5652a93d39be18154e251dd 100644 (file)
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
static int read_tree_some(struct tree *tree, const char **pathspec)
{
- read_tree_recursive(tree, "", 0, 0, pathspec, update_some, NULL);
+ struct pathspec ps;
+ init_pathspec(&ps, pathspec);
+ read_tree_recursive(tree, "", 0, 0, &ps, update_some, NULL);
+ free_pathspec(&ps);
/* update the index with the given tree's info
* for all args, expanding wildcards, and exit