def current_branch
      branch = @grit_repo.head
      return branch.name unless branch.nil?
      commit = @grit_repo.commit('HEAD')
      commit.id unless commit.nil?
    end
def current_branch
      branch = @grit_repo.head
      return branch.name unless branch.nil?
      commit = @grit_repo.commit('HEAD')
      commit.id unless commit.nil?
    end
Creates a new Git repository based on the given path

 This creates a new `Grit::Repo` instance to interface with the
 repository.

 @param [String] path The file system path of the repository
 Returns the current branch of the repository

 This is the target ref of Git's HEAD, i.e. the currently checked out
 branch. For a detached HEAD this may also be the commit ID of the checked
 out commit.

 @see Grit::Repo#head