fixes issue with detached branches

when a branch was detached it was not returned by getBranch method