]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Switch grep from non-portable BRE to portable ERE
authorMarcel Telka <marcel@telka.sk>
Fri, 17 May 2024 19:01:49 +0000 (21:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 19:13:18 +0000 (12:13 -0700)
This makes the grep usage fully POSIX compliant.  The ability to
enable ERE features in BRE using backslash is a GNU extension.

Signed-off-by: Marcel Telka <marcel@telka.sk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mergetools/vimdiff
t/t1404-update-ref-errors.sh

index 734d15a03b025e537650ee535cfa8c5f70e2474c..f8ad6b35d4dbde267d3defcf5bcd78b92c779fab 100644 (file)
@@ -325,7 +325,7 @@ gen_cmd () {
                fi
 
                # If this is a single window diff with all the buffers
-               if ! echo "$tab" | grep ",\|/" >/dev/null
+               if ! echo "$tab" | grep -E ",|/" >/dev/null
                then
                        CMD="$CMD | silent execute 'bufdo diffthis'"
                fi
index 98e9158bd2ab41f17af11612ef1bfd5e65796605..67ebd81a4c762198f34fffe43652e9a6a349a008 100755 (executable)
@@ -100,7 +100,7 @@ df_test() {
                printf "%s\n" "delete $delname" "create $addname $D"
        fi >commands &&
        test_must_fail git update-ref --stdin <commands 2>output.err &&
-       grep "fatal:\( cannot lock ref $SQ$addname$SQ:\)\? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
+       grep -E "fatal:( cannot lock ref $SQ$addname$SQ:)? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
        printf "%s\n" "$C $delref" >expected-refs &&
        git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
        test_cmp expected-refs actual-refs