]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib-functions.sh
Merge branch 'ns/batch-fsync'
[thirdparty/git.git] / t / test-lib-functions.sh
index 1c3d65e6ea98fd88a4ae30de1dfae2836312d5cd..50970d3e03eb8a2f8eb48224bf7ce288a83af0fe 100644 (file)
@@ -1782,6 +1782,16 @@ test_oid_to_path () {
        echo "${1%$basename}/$basename"
 }
 
+# Parse oids from git ls-files --staged output
+test_parse_ls_files_stage_oids () {
+       awk '{print $2}' -
+}
+
+# Parse oids from git ls-tree output
+test_parse_ls_tree_oids () {
+       awk '{print $3}' -
+}
+
 # Choose a port number based on the test script's number and store it in
 # the given variable name, unless that variable already contains a number.
 test_set_port () {
@@ -1864,40 +1874,6 @@ test_subcommand () {
        fi
 }
 
-# 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.
 #