Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2012-07-04 17:34:19 +0400
committerJunio C Hamano <gitster@pobox.com>2012-07-06 10:22:00 +0400
commit798d598080a68deb4958d69adacee409a23b467b (patch)
tree9b09f5f8899b4f0e9c1917a7feaf1d02db6c44a1 /t/lib-git-p4.sh
parentc47178d4f0d7331a75f8e0625fd2facd1b5fee4e (diff)
git p4 test: refactor marshal_dump
This function will be useful in future tests. Move it to the git-p4 test library. Let it accept an optional argument to pick a certain marshaled object out of the input stream. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-git-p4.sh')
-rw-r--r--t/lib-git-p4.sh13
1 files changed, 13 insertions, 0 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"
+}