GitRepo.isHeadDetached

Check if this repository's HEAD is detached.

A repository's HEAD is detached when it points directly to a commit instead of a branch.

struct GitRepo
@property
bool
isHeadDetached
(
)

Examples

1 // by default test repo's HEAD is pointing to a commit
2 auto repo1 = openRepository(_testRepo);
3 assert(repo1.isHeadDetached);
4 
5 // new repo does not have a detached head
6 auto repo2 = initRepo(_userRepo, OpenBare.no);
7 scope(exit) rmdirRecurse(_userRepo);
8 assert(!repo2.isHeadDetached);

Meta