]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t9*: merge "grep | sed" pipelines
authorBeat Bolli <bb@drbeat.li>
Fri, 15 Mar 2024 19:46:17 +0000 (20:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 Mar 2024 18:08:57 +0000 (11:08 -0700)
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9118-git-svn-funky-branch-names.sh
t/t9350-fast-export.sh
t/t9824-git-p4-git-lfs.sh

index a159ff96b71882362eaa7d7856289561601674cf..d3261e35b818400f0242a18a4b024877b1307823 100755 (executable)
@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '
 # SVN 1.7 will truncate "not-a%40{0]" to just "not-a".
 # Look at what SVN wound up naming the branch and use that.
 # Be sure to escape the @ if it shows up.
-non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | grep not-a | sed 's/\///' | sed 's/@/%40/')
+non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | sed -ne '/not-a/ { s/\///; s/@/%40/; p }')
 
 test_expect_success 'test clone with funky branch names' '
        git svn clone -s "$svnrepo/pr ject" project &&
index d86d07a79d4f877d17e3cc2b5f446994c41b90f3..1eb035ee4ce547d059e07c43f04102e66ebcb000 100755 (executable)
@@ -537,7 +537,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '
 
 test_expect_success 'set-up a few more tags for tag export tests' '
        git checkout -f main &&
-       HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
+       HEAD_TREE=$(git show -s --pretty=raw HEAD | sed -n "/tree/s/tree //p") &&
        git tag    tree_tag        -m "tagging a tree" $HEAD_TREE &&
        git tag -a tree_tag-obj    -m "tagging a tree" $HEAD_TREE &&
        git tag    tag-obj_tag     -m "tagging a tag" tree_tag-obj &&
index fd430403d716d2edecfa59dfcf068afc9247f41e..80c8c31e320fd5bbf0912d093682dcad3f287fc3 100755 (executable)
@@ -18,7 +18,7 @@ test_file_in_lfs () {
        sed -n '3,3 p' "$FILE" | grep "^size " &&
        test_line_count = 3 "$FILE" &&
        grep "size $SIZE" "$FILE" &&
-       HASH=$(grep "oid sha256:" "$FILE" | sed -e "s/oid sha256://g") &&
+       HASH=$(sed -ne "/oid sha256:/s/oid sha256://gp" "$FILE") &&
        LFS_FILE=".git/lfs/objects/$(echo "$HASH" | cut -c1-2)/$(echo "$HASH" | cut -c3-4)/$HASH" &&
        echo $EXPECTED_CONTENT >expect &&
        test_path_is_file "$FILE" &&