libgit2 checkout options.paths ignores negation prefix

Viewed 56

Using libgit2 I am trying to run git_checkout_tree on all files in my working tree while skipping some specific files. Filling the git_checkout_options checkout_opts like so

char* p[2]= {"*", "!myFile.dat"};
checkout_opts.paths.strings = p;
checkout_opts.paths.count = 2;

does still checkout myFile.dat (which is located in the repository root). I tried to stick to the .gitignore pattern syntax. I've compiled libgit2 and tried to get my head around the code base. I see that wildmatch.c defines a NEGATE_CLASS '!' and a NEGATE_CLASS '^'. Using ^myFile.dat doesn't work, unfortunately. Is pattern negation not supported in libgit2 or am I doing something wrong?

1 Answers
Related