]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib-functions.sh
Merge branch 'ds/bundle-uri-3'
[thirdparty/git.git] / t / test-lib-functions.sh
index adc0fb6330c13635b69f2815ba43348ecf245fda..29d914a12ba170c30ba64c627a508a04dac239d4 100644 (file)
@@ -1868,3 +1868,14 @@ test_is_magic_mtime () {
        rm -f .git/test-mtime-actual
        return $ret
 }
+
+# Given two filenames, parse both using 'git config --list --file'
+# and compare the sorted output of those commands. Useful when
+# wanting to ignore whitespace differences and sorting concerns.
+test_cmp_config_output () {
+       git config --list --file="$1" >config-expect &&
+       git config --list --file="$2" >config-actual &&
+       sort config-expect >sorted-expect &&
+       sort config-actual >sorted-actual &&
+       test_cmp sorted-expect sorted-actual
+}