diff options
author | Dennis Kaarsemaker <dennis@kaarsemaker.net> | 2013-11-10 23:17:38 +0100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-12-16 15:25:22 +1100 |
commit | 6b44ec6808e2eea9951ccf5c3e5ec4ed5bdbc0ba (patch) | |
tree | 05079cd0708d6fe01cf588f06353f079903fe4be /t/test.pl | |
parent | c260629609c130544b7b1f0ca490292d084319bc (diff) | |
download | perl-6b44ec6808e2eea9951ccf5c3e5ec4ed5bdbc0ba.tar.gz |
Make tests work with detached git dir
In my jenkins replacement, I run all tests with .git outside the work tree,
pointed to by $GIT_DIR. This is fairly common git practice, so let's make the
testsuite support this and run the relevant porting tests that are skipped
without this patch.
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -176,6 +176,13 @@ sub find_git_or_skip { } $source_dir = $where; } + } elsif (exists $ENV{GIT_DIR}) { + my $commit = '8d063cd8450e59ea1c611a2f4f5a21059a2804f1'; + my $out = `git rev-parse --verify --quiet '$commit^{commit}'`; + chomp $out; + if($out eq $commit) { + $source_dir = '.' + } } if ($source_dir) { my $version_string = `git --version`; |