@Test public void buildWithBranch() throws IOException { GitFileSystem gfs = Gfs.newFileSystem("test_branch", repo); assertEquals("test_branch", gfs.getStatusProvider().branch()); }
@Nonnull public GfsConfiguration branch(String name) throws IOException { if(commit != null) throw new HeadAlreadyDefinedException(); if(!branchExists(name, repo) && exists(name, repo)) commit = getCommit(name, repo); else { branch = RefUtils.fullBranchName(name); Ref ref = repo.exactRef(branch); if(ref != null) commit = getCommit(ref, repo); } return this; }
GfsConfiguration { @Nonnull public GfsConfiguration branch(String name) throws IOException { if(commit != null) throw new HeadAlreadyDefinedException(); if(!branchExists(name, repo) && exists(name, repo)) commit = getCommit(name, repo); else { branch = RefUtils.fullBranchName(name); Ref ref = repo.exactRef(branch); if(ref != null) commit = getCommit(ref, repo); } return this; } }
GfsConfiguration { @Nonnull public GfsConfiguration branch(String name) throws IOException { if(commit != null) throw new HeadAlreadyDefinedException(); if(!branchExists(name, repo) && exists(name, repo)) commit = getCommit(name, repo); else { branch = RefUtils.fullBranchName(name); Ref ref = repo.exactRef(branch); if(ref != null) commit = getCommit(ref, repo); } return this; } GfsConfiguration(Repository repo); }
GfsConfiguration { @Nonnull public GfsConfiguration branch(String name) throws IOException { if(commit != null) throw new HeadAlreadyDefinedException(); if(!branchExists(name, repo) && exists(name, repo)) commit = getCommit(name, repo); else { branch = RefUtils.fullBranchName(name); Ref ref = repo.exactRef(branch); if(ref != null) commit = getCommit(ref, repo); } return this; } GfsConfiguration(Repository repo); @Nonnull static GfsConfiguration repo(Repository repo); @Nonnull static GfsConfiguration inMemoryRepo(); @Nonnull static GfsConfiguration fileRepo(File repoDir); @Nonnull static GfsConfiguration fileRepo(String repoDir); @Nonnull static GfsConfiguration fileRepo(Path repoDir); @Nonnull static GfsConfiguration fromPath(Path repoDir, Map<String, ?> props); @Nonnull static GfsConfiguration fromUri(URI uri, Map<String, ?> props); @Nonnull Repository repository(); @Nonnull GfsConfiguration branch(String name); @Nonnull GfsConfiguration branch(Ref ref); @Nullable String branch(); @Nonnull GfsConfiguration commit(RevCommit commit); @Nonnull GfsConfiguration commit(AnyObjectId id); @Nonnull GfsConfiguration commit(String id); @Nullable RevCommit commit(); }
GfsConfiguration { @Nonnull public GfsConfiguration branch(String name) throws IOException { if(commit != null) throw new HeadAlreadyDefinedException(); if(!branchExists(name, repo) && exists(name, repo)) commit = getCommit(name, repo); else { branch = RefUtils.fullBranchName(name); Ref ref = repo.exactRef(branch); if(ref != null) commit = getCommit(ref, repo); } return this; } GfsConfiguration(Repository repo); @Nonnull static GfsConfiguration repo(Repository repo); @Nonnull static GfsConfiguration inMemoryRepo(); @Nonnull static GfsConfiguration fileRepo(File repoDir); @Nonnull static GfsConfiguration fileRepo(String repoDir); @Nonnull static GfsConfiguration fileRepo(Path repoDir); @Nonnull static GfsConfiguration fromPath(Path repoDir, Map<String, ?> props); @Nonnull static GfsConfiguration fromUri(URI uri, Map<String, ?> props); @Nonnull Repository repository(); @Nonnull GfsConfiguration branch(String name); @Nonnull GfsConfiguration branch(Ref ref); @Nullable String branch(); @Nonnull GfsConfiguration commit(RevCommit commit); @Nonnull GfsConfiguration commit(AnyObjectId id); @Nonnull GfsConfiguration commit(String id); @Nullable RevCommit commit();  }