]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5411/common-functions.sh
Merge branch 'jx/t5411-unique-filenames'
[thirdparty/git.git] / t / t5411 / common-functions.sh
index 13107fcdb65c4c1d3274130a3f9fd86a6ffc0a3d..6694858e187a8a1607abbf69100706f56f0cd24b 100644 (file)
@@ -58,3 +58,18 @@ filter_out_user_friendly_and_stable_output () {
        make_user_friendly_and_stable_output |
                sed -n ${1+"$@"}
 }
+
+test_cmp_refs () {
+       indir=
+       if test "$1" = "-C"
+       then
+               shift
+               indir="$1"
+               shift
+       fi
+       indir=${indir:+"$indir"/}
+       cat >show-ref.expect &&
+       git ${indir:+ -C "$indir"} show-ref >show-ref.pristine &&
+       make_user_friendly_and_stable_output <show-ref.pristine >show-ref.filtered &&
+       test_cmp show-ref.expect show-ref.filtered
+}