Switch grep from non-portable BRE to portable ERE
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>
Marcel Telka committed
May 17, 2024 at 21:01 UTC
0f063b6c766fc98124f60b6b0f8424142641ff88
2 files changed
+2
-2
mergetools/vimdiff
+1
-1
@@ -325,7 +325,7 @@ gen_cmd () {
325
fi
326
327
# If this is a single window diff with all the buffers
328
- if ! echo "$tab" | grep ",\|/" >/dev/null
328
+ if ! echo "$tab" | grep -E ",|/" >/dev/null
329
then
330
CMD="$CMD | silent execute 'bufdo diffthis'"
331
fi
t/t1404-update-ref-errors.sh
+1
-1
@@ -100,7 +100,7 @@ df_test() {
100
printf "%s\n" "delete $delname" "create $addname $D"
101
fi >commands &&
102
test_must_fail git update-ref --stdin <commands 2>output.err &&
103
- grep "fatal:\( cannot lock ref $SQ$addname$SQ:\)\? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
103
+ grep -E "fatal:( cannot lock ref $SQ$addname$SQ:)? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err &&
104
printf "%s\n" "$C $delref" >expected-refs &&
105
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
106
test_cmp expected-refs actual-refs