Skip to content

Commit 37495ee

Browse files
sschuberthgitster
authored andcommitted
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: http://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor Signed-off-by: Sebastian Schuberth <[email protected]> Tested-by: Pat Thoyts <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4397c65 commit 37495ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git-cvsexportcommit.perl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
chomp($gd);
3131
$ENV{GIT_DIR} = $gd;
3232
}
33+
34+
# On MSYS, convert a Windows-style path to an MSYS-style path
35+
# so that rel2abs() below works correctly.
36+
if ($^O eq 'msys') {
37+
$ENV{GIT_DIR} =~ s#^([[:alpha:]]):/#/$1/#;
38+
}
39+
3340
# Make sure GIT_DIR is absolute
3441
$ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});
3542
}

0 commit comments

Comments
 (0)