Git development
 help / color / mirror / Atom feed
* [PATCH] contrib/git-svn: force GIT_DIR to an absolute path
@ 2006-03-30  6:37 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2006-03-30  6:37 UTC (permalink / raw)
  To: Junio C Hamano, git; +Cc: Eric Wong

We chdir internally, so we need a consistent GIT_DIR variable.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

---

 contrib/git-svn/git-svn.perl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

40a9f8f87bbf041966c61431536186d03acefb50
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 3e5733e..59dd504 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -9,7 +9,11 @@ use vars qw/	$AUTHOR $VERSION
 		$GIT_DIR $REV_DIR/;
 $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
 $VERSION = '0.11.0';
-$GIT_DIR = $ENV{GIT_DIR} || "$ENV{PWD}/.git";
+
+use Cwd qw/abs_path/;
+$GIT_DIR = abs_path($ENV{GIT_DIR} || '.git');
+$ENV{GIT_DIR} = $GIT_DIR;
+
 # make sure the svn binary gives consistent output between locales and TZs:
 $ENV{TZ} = 'UTC';
 $ENV{LC_ALL} = 'C';
@@ -69,7 +73,6 @@ GetOptions(%opts, 'help|H|h' => \$_help,
 
 $GIT_SVN ||= $ENV{GIT_SVN_ID} || 'git-svn';
 $GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
-$ENV{GIT_DIR} ||= $GIT_DIR;
 $SVN_URL = undef;
 $REV_DIR = "$GIT_DIR/$GIT_SVN/revs";
 $SVN_WC = "$GIT_DIR/$GIT_SVN/tree";
-- 
1.3.0.rc1.g709a5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-30  6:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-30  6:37 [PATCH] contrib/git-svn: force GIT_DIR to an absolute path Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox