From 0255fc08fcbf1ca1735ba3997c71202baacd198d Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Thu, 17 Jul 2008 21:48:57 +0200 Subject: [PATCH] gitstats: Don't assume the temp path is /tmp Instead, use the value returned by the script when running it with the 'path' argument by passing it that value as a third argument on a second run. --- src/t/t8100-stats.sh | 13 ++++++++++--- src/t/t8101-metrics.sh | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/t/t8100-stats.sh b/src/t/t8100-stats.sh index 629b1af..314ada4 100755 --- a/src/t/t8100-stats.sh +++ b/src/t/t8100-stats.sh @@ -17,9 +17,16 @@ export GIT_STATS_PRETTY_PRINT="oneline" # Setup ########### +test_expect_success 'extract test repo path' ' + TEST_REPO_PATH=$(../scripts/setupRepo.py test path) || { + trap - exit + echo >&5 "FATAL: Cannot extract test repo path" + exit 1 + } +' test_expect_success 'pre-clean' ' - rm -fr "/tmp/testrepo" || { + rm -fr "$TEST_REPO_PATH" || { trap - exit echo >&5 "FATAL: Cannot clean the fresh repo" exit 1 @@ -27,8 +34,8 @@ test_expect_success 'pre-clean' ' ' test_expect_success 'setup' ' - ../scripts/setupRepo.py test && \ - cd "/tmp/testrepo" || { + ../scripts/setupRepo.py test path "$TEST_REPO_PATH" && \ + cd "$TEST_REPO_PATH" || { trap - exit echo >&5 "FATAL: Cannot cd into fresh repo" exit 1 diff --git a/src/t/t8101-metrics.sh b/src/t/t8101-metrics.sh index 46667c6..5360476 100755 --- a/src/t/t8101-metrics.sh +++ b/src/t/t8101-metrics.sh @@ -16,9 +16,16 @@ ORIG_PATH=$PWD # Setup ########### +test_expect_success 'extract test repo path' ' + METRICS_REPO_PATH=$(../scripts/setupRepo.py metrics path) || { + trap - exit + echo >&5 "FATAL: Cannot extract test repo path" + exit 1 + } +' test_expect_success 'pre-clean' ' - rm -fr "/tmp/metricsrepo" || { + rm -fr "$METRICS_REPO_PATH" || { trap - exit echo >&5 "FATAL: Cannot clean the fresh repo" exit 1 @@ -26,8 +33,8 @@ test_expect_success 'pre-clean' ' ' test_expect_success 'setup' ' - ../scripts/setupRepo.py metrics && \ - cd "/tmp/metricsrepo" || { + ../scripts/setupRepo.py metrics path "$METRICS_REPO_PATH" && \ + cd "$METRICS_REPO_PATH" || { trap - exit echo >&5 "FATAL: Cannot cd into fresh repo" exit 1 -- 2.11.4.GIT