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:
authorJunio C Hamano <gitster@pobox.com>2022-01-06 01:01:30 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-06 01:01:30 +0300
commit88a516aca03e55f174fc1884250be1d0d3fb9fa8 (patch)
tree8ad963a4f270b9184d6774bcabf8c3a74f783bb3 /t/test-lib-functions.sh
parentbb14cfdfd74c37f4319405eaebce0691c5b51db0 (diff)
parent47ca93d0710c114b61b3079d3b88d2d7528f5666 (diff)
Merge branch 'ds/repack-fixlets'
Two fixes around "git repack". * ds/repack-fixlets: repack: make '--quiet' disable progress repack: respect kept objects with '--write-midx -b'
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 389153e591..c3d38aaccb 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1760,6 +1760,40 @@ test_subcommand () {
}
# Check that the given command was invoked as part of the
+# trace2-format trace on stdin, but without an exact set of
+# arguments.
+#
+# test_subcommand [!] <command> <args>... < <trace>
+#
+# For example, to look for an invocation of "git pack-objects"
+# with the "--honor-pack-keep" argument, use
+#
+# GIT_TRACE2_EVENT=event.log git repack ... &&
+# test_subcommand git pack-objects --honor-pack-keep <event.log
+#
+# If the first parameter passed is !, this instead checks that
+# the given command was not called.
+#
+test_subcommand_inexact () {
+ local negate=
+ if test "$1" = "!"
+ then
+ negate=t
+ shift
+ fi
+
+ local expr=$(printf '"%s".*' "$@")
+ expr="${expr%,}"
+
+ if test -n "$negate"
+ then
+ ! grep "\"event\":\"child_start\".*\[$expr\]"
+ else
+ grep "\"event\":\"child_start\".*\[$expr\]"
+ fi
+}
+
+# Check that the given command was invoked as part of the
# trace2-format trace on stdin.
#
# test_region [!] <category> <label> git <command> <args>...