codejammer
codejammer

Reputation: 1676

How to use JGit api to checkout remote files?

Using the command line git commands I can do the following

git checkout ref/origin/remotebranch projectA/*

However if i do the following using jgit, the files under projectA/* are not checked out.

    CheckoutCommand checkout= git.checkout();
    checkout.addPath("projectA/*");
    checkout.setName("ref/origin/remotebranch");
    checkout.setAllPaths(false);//tried with both true and false
    checkout.call();

How to resolve this in JGit?

Upvotes: 0

Views: 954

Answers (1)

robinst
robinst

Reputation: 31407

I'm not sure if the glob notation is supported, so try this instead:

checkout.addPath("projectA");

setAllPaths should not be necessary.

Upvotes: 1

Related Questions