* only try to get HeadBranch if HeadRepo exist * impruve * no nil error * add TEST * correct error msg