Re: [PATCH v2] git-svn: Simplify calculation of GIT_DIR
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Mar 8, 2012, 00:51 UTC
- Message-ID
- <20120308005103.GA27398@dcvr.yhbt.net>
- In-Reply-To
- <1330804397-43062-1-git-send-email-barry.wardell@gmail.com>
Barry Wardell <barry.wardell@gmail.com> wrote:
> -my $git_dir_user_set = 1 if defined $ENV{GIT_DIR};
> -$ENV{GIT_DIR} ||= '.git';<snip>
> unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {<snip>
Show 7 quoted lines
> + git_cmd_try {
> + $ENV{GIT_DIR} = command_oneline([qw/rev-parse --git-dir/]);
> + } "Unable to find .git directory\n";
> +
> + chdir $toplevel or die "Unable to chdir to '$toplevel'\n";
> $_repository = Git->repository(Repository => $ENV{GIT_DIR});
> }It looks like some places in "git svn (init|clone|multi-init)" rely on GIT_DIR being set. I noticed the first test of t9100-git-svn-basic.sh failing (causing everything else in that test to fail) with your patch.
Can you fix those use cases (and ensure tests pass)? Thanks.