public Ref getCurrentBranch ( ) throws IOException , JavaGitException { GitBranch gitBranch = new GitBranch ( ) ; GitBranchOptions options = new GitBranchOptions ( ) ; GitBranchResponse response = gitBranch . branch ( path , options ) ; return response . getCurrentBranch ( ) ; }
Gets the currently checked - out branch of the working directory .