t: convert fgrep usage to "grep -F"

Despite POSIX states that: > The old egrep and fgrep commands are likely to be supported for many > years to come as implementation extensions, allowing historical > applications to operate unmodified. GNU grep 3.8 started to warn[1]: > The egrep and fgrep commands, which have been deprecated since > release 2.5.3 (2007), now warn that they are obsolescent and should > be replaced by grep -E and grep -F. Prepare for their removal in the future. [1]: https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Đoàn Trần Công Danh committed Sep 21, 2022 at 20:02 UTC 37eb90f79a97cfeb216c7afe7bb0f129edfc10e4
6 files changed +16 -16
t/t3700-add.sh
+1 -1
@@ -291,7 +291,7 @@ test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
291 git reset --hard &&
292 touch fo\[ou\]bar foobar &&
293 git add '\''fo\[ou\]bar'\'' &&
294 - git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
294 + git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
295 ! ( git ls-files foobar | grep foobar )
296 '
297
t/t7003-filter-branch.sh
+2 -2
@@ -49,7 +49,7 @@ test_expect_success 'result is really identical' '
49 test_expect_success 'rewrite bare repository identically' '
50 (git config core.bare true && cd .git &&
51 git filter-branch branch > filter-output 2>&1 &&
52 - ! fgrep fatal filter-output)
52 + ! grep fatal filter-output)
53 '
54 git config core.bare false
55 test_expect_success 'result is really identical' '
@@ -506,7 +506,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit
506 git tag -a -m "tag to a tree" treetag $new_tree &&
507 git reset --hard HEAD &&
508 git filter-branch -f -- --all >filter-output 2>&1 &&
509 - ! fgrep fatal filter-output
509 + ! grep fatal filter-output
510 '
511
512 test_expect_success 'filter-branch handles ref deletion' '
t/t9133-git-svn-nested-git-repo.sh
+3 -3
@@ -35,7 +35,7 @@ test_expect_success 'SVN-side change outside of .git' '
35 echo b >> a &&
36 svn_cmd commit -m "SVN-side change outside of .git" &&
37 svn_cmd up &&
38 - svn_cmd log -v | fgrep "SVN-side change outside of .git"
38 + svn_cmd log -v | grep -F "SVN-side change outside of .git"
39 )
40 '
41
@@ -59,7 +59,7 @@ test_expect_success 'SVN-side change inside of .git' '
59 svn_cmd add --force .git &&
60 svn_cmd commit -m "SVN-side change inside of .git" &&
61 svn_cmd up &&
62 - svn_cmd log -v | fgrep "SVN-side change inside of .git"
62 + svn_cmd log -v | grep -F "SVN-side change inside of .git"
63 )
64 '
65
@@ -82,7 +82,7 @@ test_expect_success 'SVN-side change in and out of .git' '
82 git commit -m "add a inside an SVN repo" &&
83 svn_cmd commit -m "SVN-side change in and out of .git" &&
84 svn_cmd up &&
85 - svn_cmd log -v | fgrep "SVN-side change in and out of .git"
85 + svn_cmd log -v | grep -F "SVN-side change in and out of .git"
86 )
87 '
88
t/t9134-git-svn-ignore-paths.sh
+4 -4
@@ -43,7 +43,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '
43 test_expect_success 'verify ignore-paths config saved by clone' '
44 (
45 cd g &&
46 - git config --get svn-remote.svn.ignore-paths | fgrep "www"
46 + git config --get svn-remote.svn.ignore-paths | grep www
47 )
48 '
49
@@ -53,7 +53,7 @@ test_expect_success 'SVN-side change outside of www' '
53 echo b >> qqq/test_qqq.txt &&
54 svn_cmd commit -m "SVN-side change outside of www" &&
55 svn_cmd up &&
56 - svn_cmd log -v | fgrep "SVN-side change outside of www"
56 + svn_cmd log -v | grep "SVN-side change outside of www"
57 )
58 '
59
@@ -85,7 +85,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
85 echo zaq >> www/test_www.txt &&
86 svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
87 svn_cmd up &&
88 - svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
88 + svn_cmd log -v | grep -F "SVN-side change inside of www/test_www.txt"
89 )
90 '
91
@@ -118,7 +118,7 @@ test_expect_success 'SVN-side change in and out of ignored www' '
118 echo ygg >> qqq/test_qqq.txt &&
119 svn_cmd commit -m "SVN-side change in and out of ignored www" &&
120 svn_cmd up &&
121 - svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
121 + svn_cmd log -v | grep "SVN-side change in and out of ignored www"
122 )
123 '
124
t/t9140-git-svn-reset.sh
+2 -2
@@ -43,7 +43,7 @@ test_expect_success 'fetch fails on modified hidden file' '
43 git svn find-rev refs/remotes/git-svn > ../expect &&
44 test_must_fail git svn fetch 2> ../errors &&
45 git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
46 - fgrep "not found in commit" errors &&
46 + grep "not found in commit" errors &&
47 test_cmp expect expect2
48 '
49
@@ -59,7 +59,7 @@ test_expect_success 'refetch succeeds not ignoring any files' '
59 ( cd g &&
60 git svn fetch &&
61 git svn rebase &&
62 - fgrep "mod hidden" hid/hid.txt
62 + grep "mod hidden" hid/hid.txt
63 )
64 '
65
t/t9147-git-svn-include-paths.sh
+4 -4
@@ -45,7 +45,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '
45 test_expect_success 'verify include-paths config saved by clone' '
46 (
47 cd g &&
48 - git config --get svn-remote.svn.include-paths | fgrep "qqq"
48 + git config --get svn-remote.svn.include-paths | grep qqq
49 )
50 '
51
@@ -55,7 +55,7 @@ test_expect_success 'SVN-side change outside of www' '
55 echo b >> qqq/test_qqq.txt &&
56 svn_cmd commit -m "SVN-side change outside of www" &&
57 svn_cmd up &&
58 - svn_cmd log -v | fgrep "SVN-side change outside of www"
58 + svn_cmd log -v | grep "SVN-side change outside of www"
59 )
60 '
61
@@ -87,7 +87,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
87 echo zaq >> www/test_www.txt &&
88 svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
89 svn_cmd up &&
90 - svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
90 + svn_cmd log -v | grep "SVN-side change inside of www/test_www.txt"
91 )
92 '
93
@@ -120,7 +120,7 @@ test_expect_success 'SVN-side change in and out of included qqq' '
120 echo ygg >> qqq/test_qqq.txt &&
121 svn_cmd commit -m "SVN-side change in and out of ignored www" &&
122 svn_cmd up &&
123 - svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
123 + svn_cmd log -v | grep "SVN-side change in and out of ignored www"
124 )
125 '
126