headBranch method

String? headBranch()

The branch HEAD names, or null when it is detached. For a bare repository this is its default branch; for a working one, the branch checked out.

Implementation

String? headBranch() => _branchOf(File(p.join(gitDir, 'HEAD')));