summaryrefslogtreecommitdiff
path: root/contrib/git-svn/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-03-30 06:37:18 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-30 23:40:38 (GMT)
commit13ccd6d4f2086ace8f70dc8a60a40ac5836dc881 (patch)
tree0fb8706cc3b6e8534c91cba9f51a273810bdf2b0 /contrib/git-svn/git-svn.perl
parentef5b4eabb6da7cead197e387589896345d3dfbc6 (diff)
downloadgit-13ccd6d4f2086ace8f70dc8a60a40ac5836dc881.zip
git-13ccd6d4f2086ace8f70dc8a60a40ac5836dc881.tar.gz
git-13ccd6d4f2086ace8f70dc8a60a40ac5836dc881.tar.bz2
contrib/git-svn: force GIT_DIR to an absolute path
We chdir internally, so we need a consistent GIT_DIR variable. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'contrib/git-svn/git-svn.perl')
-rwxr-xr-xcontrib/git-svn/git-svn.perl7
1 files changed, 5 insertions, 2 deletions
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";