javagit/src/main/java/edu/nyu/cs/javagit/api/WorkingTree.java
public Ref getCurrentBranch() throws IOException, JavaGitException {
    GitBranch gitBranch = new GitBranch();
    GitBranchOptions options = new GitBranchOptions();
    GitBranchResponse response = gitBranch.branch(path, options);
    return response.getCurrentBranch();
  }
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.

@return The currently checked-out branch of the working directory.