Fixes git branch detection in subdirectories