Skip to content

Instantly share code, notes, and snippets.

@robinst
Created August 13, 2012 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinst/3338160 to your computer and use it in GitHub Desktop.
Save robinst/3338160 to your computer and use it in GitHub Desktop.
JGit checkout of directory
@Test
public void testCheckoutOfDirectoryShouldBeRecursive() throws Exception {
File a = writeTrashFile("dir/a.txt", "A");
File b = writeTrashFile("dir/sub/b.txt", "B");
git.add().addFilepattern("dir").call();
write(a, "modified");
write(b, "modified");
git.checkout().addPath("dir").call();
assertThat(read(a), is("A"));
assertThat(read(b), is("B"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment