diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index c4c3d1a15d..fc2cc9d37b 100755 --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@ -777,6 +777,13 @@ test_expect_success 'repack -ad cleans up old .tmp-* packs' ' test_must_be_empty tmpfiles ' +test_expect_success '--full-name-hash option passes through to pack-objects' ' + GIT_TRACE2_EVENT="$(pwd)/full-trace.txt" \ + git repack -a --full-name-hash && + test_subcommand_flex git pack-objects --full-name-hash ... < +# +# If the first parameter passed is !, this instead checks that +# the given command was not called. +# +test_subcommand_flex () { + local negate= + if test "$1" = "!" + then + negate=t + shift + fi + + local expr="$(printf '"%s".*' "$@")" + + if test -n "$negate" + then + ! grep "\[$expr\]" + else + grep "\[$expr\]" + fi +} + # Check that the given command was invoked as part of the # trace2-format trace on stdin. #