APF-1454: Fixed logic when no git branch exists (HEAD gets set as branch name).