Johannes Schindelin <johannes.schindelin@xxxxxx> writes: > -static char *orig_env[4]; > -static int save_restore_env_balance; > - > -static void save_env_before_alias(void) > -{ > -... > -} > - > -static void restore_env(int external_alias) > -{ > -... > -} > > static void commit_pager_choice(void) { > switch (use_pager) { > @@ -245,36 +201,37 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) > > static int handle_alias(int *argcp, const char ***argv) > { > + struct strbuf worktree_dir = STRBUF_INIT; > int envchanged = 0, ret = 0, saved_errno = errno; > int count, option_count; > const char **new_argv; > const char *alias_command; > char *alias_string; > - int unused_nongit; > - > - save_env_before_alias(); > - setup_git_directory_gently(&unused_nongit); > ... > @@ -308,8 +265,6 @@ static int handle_alias(int *argcp, const char ***argv) > ret = 1; > } > > - restore_env(0); > - > errno = saved_errno; The save/restore sequence was an unnecessary hassle, and being able to do this without chdir'ing around is really nice. Thanks for working on this.