]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib-functions.sh
Merge branch 'jc/apply-ws-fix-tab-in-indent'
[thirdparty/git.git] / t / test-lib-functions.sh
index fa62d010f68e3ee97e6754687ad4d08564d3c96b..42c2258b4fdf37b9d2e440f0918f8e4e4f7608f0 100644 (file)
@@ -91,6 +91,10 @@ q_to_tab () {
        tr Q '\011'
 }
 
+qz_to_tab_space () {
+       tr QZ '\011\040'
+}
+
 append_cr () {
        sed -e 's/$/Q/' | tr Q '\015'
 }
@@ -135,12 +139,12 @@ test_pause () {
        fi
 }
 
-# Call test_commit with the arguments "<message> [<file> [<contents>]]"
+# Call test_commit with the arguments "<message> [<file> [<contents> [<tag>]]]"
 #
 # This will commit a file with the given contents and the given commit
-# message.  It will also add a tag with <message> as name.
+# message, and tag the resulting commit with the given tag name.
 #
-# Both <file> and <contents> default to <message>.
+# <file>, <contents>, and <tag> all default to <message>.
 
 test_commit () {
        notick= &&
@@ -168,7 +172,7 @@ test_commit () {
                test_tick
        fi &&
        git commit $signoff -m "$1" &&
-       git tag "$1"
+       git tag "${4:-$1}"
 }
 
 # Call test_merge with the arguments "<message> <commit>", where <commit>