Fix Git commit ID detection in Git worktrees

Authored by Sylvain Henry <hsyl20@gmail.com> on Jul 28 2018, 10:48 AM.