Sebastian Schuberth committed 37495ee

git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS

Due to MSYS path mangling GIT_DIR contains a Windows-style path when
checked inside a Perl script even if GIT_DIR was previously set to an
MSYS-style path in a shell script. So explicitly convert to an MSYS-style
path before calling Perl's rel2abs() to make it work.

This fix was inspired by a very similar patch in WebKit:

Signed-off-by: Sebastian Schuberth <>
Tested-by: Pat Thoyts <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 4397c65

Comments (0)

Files changed (1)


 		$ENV{GIT_DIR} = $gd;
+	# On MSYS, convert a Windows-style path to an MSYS-style path
+	# so that rel2abs() below works correctly.
+	if ($^O eq 'msys') {
+		$ENV{GIT_DIR} =~ s#^([[:alpha:]]):/#/$1/#;
+	}
 	# Make sure GIT_DIR is absolute
 	$ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});