Allow to specify a branch for getting the current commit.