summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/lib-git-p4.sh13
-rwxr-xr-xt/t9800-git-p4-basic.sh5
2 files changed, 13 insertions, 5 deletions
diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index 31d75ae043..2d753ab7e1 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -102,3 +102,16 @@ cleanup_git() {
rm -rf "$git" &&
mkdir "$git"
}
+
+marshal_dump() {
+ what=$1 &&
+ line=${2:-1} &&
+ cat >"$TRASH_DIRECTORY/marshal-dump.py" <<-EOF &&
+ import marshal
+ import sys
+ for i in range($line):
+ d = marshal.load(sys.stdin)
+ print d['$what']
+ EOF
+ "$PYTHON_PATH" "$TRASH_DIRECTORY/marshal-dump.py"
+}
diff --git a/t/t9800-git-p4-basic.sh b/t/t9800-git-p4-basic.sh
index 07c2e157cb..b7ad716b09 100755
--- a/t/t9800-git-p4-basic.sh
+++ b/t/t9800-git-p4-basic.sh
@@ -155,11 +155,6 @@ test_expect_success 'clone bare' '
)
'
-marshal_dump() {
- what=$1
- "$PYTHON_PATH" -c 'import marshal, sys; d = marshal.load(sys.stdin); print d["'$what'"]'
-}
-
# Sleep a bit so that the top-most p4 change did not happen "now". Then
# import the repo and make sure that the initial import has the same time
# as the top-most change.