git-subrepo
git-subrepo copied to clipboard
make test doesn't work when run without .git directory
make test
doesn't work when run from a directory without git, e.g. from a tarball.
Is this necessary?
It would be cool if we could run the tests when building the rpm (or deb) package.
Reproduce:
% mv .git .git.bak
% make test
prove test/
test/branch-all.t ................ fatal: not in a git directory
test/branch-all.t ................ Dubious, test returned 128 (wstat 32768, 0x8000)
No subtests run
test/branch-rev-list-one-path.t .. fatal: not in a git directory
test/branch-rev-list-one-path.t .. Dubious, test returned 128 (wstat 32768, 0x8000)
No subtests run
...
Sorry I didn't test earlier, but #488 apparently did not fix this. I'm still getting the same errors for 0.4.3
@perlpunk's repo still causes failure:
% mv .git .git.bak
% make test
This patch might do the trick:
diff --git a/test/setup b/test/setup
index fc19786..bfe7667 100644
--- a/test/setup
+++ b/test/setup
@@ -8,6 +8,10 @@ set -e
# Set the GIT_SUBREPO_ROOT for testing.
source "$PWD"/.rc
+if [[ ! -e $GIT_SUBREPO_ROOT/.git ]]; then
+ git clone --bare https://github.com/ingydotnet/git-subrepo.git "$GIT_SUBREPO_ROOT/.git"
+fi
+
# Get the location of this script
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
This won't work for our case. We would like to do testing in the openSUSE build, and in there we don't have network access.
Makes sense