Skip to content

Commit

Permalink
Better work with files
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatej committed Mar 11, 2011
1 parent 7547f14 commit 94403ec
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/com/atlassian/labs/bamboo/git/GitRepository.java
Expand Up @@ -154,11 +154,7 @@ public boolean referencesDifferentRepository() {
@Override
public File getSourceCodeDirectory(@NotNull String s) throws RepositoryException {
File codeDirectory = super.getSourceCodeDirectory(s);
try {
return new File(codeDirectory.getCanonicalPath() + File.separator + "checkout");
} catch (IOException e) {
throw new RepositoryException("getSourceCodeDirectory", e);
}
return new File(codeDirectory, "checkout");
}

// Todo: Make sure we use vcsRevisionKey in cloneOrFetch
Expand Down Expand Up @@ -501,8 +497,8 @@ public static File getLocalCheckoutSubfolder() {
}


static boolean containsValidRepo(File sourceDir) throws IOException {
return sourceDir.exists() && (new File( sourceDir.getCanonicalPath() + File.separator + ".git").exists() || new File( sourceDir.getCanonicalPath() + File.separator + "HEAD").exists());
protected static boolean containsValidRepo(File sourceDir) throws IOException {
return sourceDir.exists() && (new File(sourceDir, ".git").exists() || new File(sourceDir, "HEAD").exists());
}

boolean isOnBranch(File sourceDir, Ref branchName) throws IOException, JavaGitException {
Expand Down

0 comments on commit 94403ec

Please sign in to comment.