diff --git a/git-hg-helper b/git-hg-helper index 8197d44..8a3538c 100755 --- a/git-hg-helper +++ b/git-hg-helper @@ -923,15 +923,15 @@ def check_version(*check): def main(argv): global subcommands - # init repo dir - # we will take over dir management ... - init_git(os.environ.pop('GIT_DIR', None)) - # as an alias, cwd is top dir, change again to original directory reldir = os.environ.get('GIT_PREFIX') if reldir: os.chdir(reldir) + # init repo dir + # we will take over dir management ... + init_git(os.environ.pop('GIT_DIR', None)) + subcommands = get_subcommands() cmd = ''