public boolean hasGitRepo(String gitDir) throws GitException { if (workspace == null) { return false; } try { FilePath dotGit = workspace.child(gitDir); return dotGit.exists(); } catch (SecurityException ex) { throw new GitException(Messages.GitAPI_Repository_SecurityFailureCheckMsg(), ex); } catch (Exception e) { throw new GitException(Messages.GitAPI_Repository_FailedCheckMsg(), e); } }