public void fetchShouldNotFetchTagsFromOtherBranches() throws Exception {
remoteGit.commit().setMessage("commit").call();
remoteGit.checkout().setName("other").setCreateBranch(true).call();
remoteGit.commit().setMessage("commit2").call();
remoteGit.tag().setName("foo").call();
RefSpec spec = new RefSpec(
"refs/heads/master:refs/remotes/origin/master");
git.fetch().setRemote("test").setRefSpecs(spec)
.setTagOpt(TagOpt.AUTO_FOLLOW).call();
assertNull(db.resolve("foo"));
}