Skip to content

Commit b528e94

Browse files
committed
Git.pm: stop assuming that absolute paths start with a slash
This fixes t7800 with MSys2. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1f8add0 commit b528e94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

perl/Git.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ sub repository {
188188
};
189189

190190
if ($dir) {
191-
$dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
191+
_verify_require();
192+
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
192193
$opts{Repository} = abs_path($dir);
193194

194195
# If --git-dir went ok, this shouldn't die either.

0 commit comments

Comments
 (0)