git p4 test: move client_view() function to library
authorPete Wyckoff <pw@padd.com>
Sat, 11 Aug 2012 16:55:00 +0000 (12:55 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 12 Aug 2012 04:42:12 +0000 (21:42 -0700)
This code will be useful in --detect-branches --use-client-spec tests.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-p4.sh
t/t9809-git-p4-client-view.sh

index 2d753ab7e118e0905e63860cc4ee6ae4932f16c4..d748c36df596b640d403626fce3200d85d68253b 100644 (file)
@@ -115,3 +115,20 @@ marshal_dump() {
        EOF
        "$PYTHON_PATH" "$TRASH_DIRECTORY/marshal-dump.py"
 }
+
+#
+# Construct a client with this list of View lines
+#
+client_view() {
+       (
+               cat <<-EOF &&
+               Client: client
+               Description: client
+               Root: $cli
+               View:
+               EOF
+               for arg ; do
+                       printf "\t$arg\n"
+               done
+       ) | p4 client -i
+}
index 7d993ef80acdf1775d70713d2b9abfb984c47c1e..281be29174b8b4fea854d72c663eaa2d46b00259 100755 (executable)
@@ -8,23 +8,6 @@ test_expect_success 'start p4d' '
        start_p4d
 '
 
-#
-# Construct a client with this list of View lines
-#
-client_view() {
-       (
-               cat <<-EOF &&
-               Client: client
-               Description: client
-               Root: $cli
-               View:
-               EOF
-               for arg ; do
-                       printf "\t$arg\n"
-               done
-       ) | p4 client -i
-}
-
 #
 # Verify these files exist, exactly.  Caller creates
 # a list of files in file "files".