Skip to content

Commit babf0b8

Browse files
Beat Bolligitster
Beat Bolli
authored andcommitted
t/t9*: merge "grep | sed" pipelines
Signed-off-by: Beat Bolli <[email protected]> Acked-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c7e7f68 commit babf0b8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

t/t9118-git-svn-funky-branch-names.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '
3838
# SVN 1.7 will truncate "not-a%40{0]" to just "not-a".
3939
# Look at what SVN wound up naming the branch and use that.
4040
# Be sure to escape the @ if it shows up.
41-
non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | grep not-a | sed 's/\///' | sed 's/@/%40/')
41+
non_reflog=$(svn_cmd ls "$svnrepo/pr ject/branches" | sed -ne '/not-a/ { s/\///; s/@/%40/; p }')
4242

4343
test_expect_success 'test clone with funky branch names' '
4444
git svn clone -s "$svnrepo/pr ject" project &&

t/t9350-fast-export.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ test_expect_success 'full-tree re-shows unmodified files' '
537537

538538
test_expect_success 'set-up a few more tags for tag export tests' '
539539
git checkout -f main &&
540-
HEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed "s/tree //") &&
540+
HEAD_TREE=$(git show -s --pretty=raw HEAD | sed -n "/tree/s/tree //p") &&
541541
git tag tree_tag -m "tagging a tree" $HEAD_TREE &&
542542
git tag -a tree_tag-obj -m "tagging a tree" $HEAD_TREE &&
543543
git tag tag-obj_tag -m "tagging a tag" tree_tag-obj &&

t/t9824-git-p4-git-lfs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_file_in_lfs () {
1818
sed -n '3,3 p' "$FILE" | grep "^size " &&
1919
test_line_count = 3 "$FILE" &&
2020
grep "size $SIZE" "$FILE" &&
21-
HASH=$(grep "oid sha256:" "$FILE" | sed -e "s/oid sha256://g") &&
21+
HASH=$(sed -ne "/oid sha256:/s/oid sha256://gp" "$FILE") &&
2222
LFS_FILE=".git/lfs/objects/$(echo "$HASH" | cut -c1-2)/$(echo "$HASH" | cut -c3-4)/$HASH" &&
2323
echo $EXPECTED_CONTENT >expect &&
2424
test_path_is_file "$FILE" &&

0 commit comments

Comments
 (0)