Get the commit hash from the right repository directory.