mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
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 <sschuberth@gmail.com> Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
4397c6535e
commit
37495eef4c
1 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,13 @@
|
||||||
chomp($gd);
|
chomp($gd);
|
||||||
$ENV{GIT_DIR} = $gd;
|
$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
|
# Make sure GIT_DIR is absolute
|
||||||
$ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});
|
$ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue