summaryrefslogtreecommitdiff
path: root/devel/got/files/patch-regress_cmdline_revert.sh
blob: 7da38092cfe8ca319d20c286e08406c2afdcd59b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- regress/cmdline/revert.sh.orig	2025-07-22 08:18:04 UTC
+++ regress/cmdline/revert.sh
@@ -1884,9 +1884,12 @@ test_revert_staged_file() {
 		> /dev/null)
 	local commit_id=`git_show_head $testroot/repo`
 
-	sed -i -e 's/line 0/line 0a/' $testroot/wt/epsilon/zeta
-	sed -i -e 's/line 4/line 4a/' $testroot/wt/epsilon/zeta
-	sed -i -e 's/line 6/line 6a/' $testroot/wt/epsilon/zeta
+	ed -s $testroot/wt/epsilon/zeta <<-\EOF
+	,s/line 0/line 0a/
+	,s/line 4/line 4a/
+	,s/line 6/line 6a/
+	w
+	EOF
 
 	# stage line 0 and line 6
 	printf "y\n" > $testroot/patchscript
@@ -1991,9 +1994,12 @@ test_revert_partially_staged_file() {
 		> /dev/null)
 	local commit_id=`git_show_head $testroot/repo`
 
-	sed -i -e 's/line 0/line 0a/' $testroot/wt/epsilon/zeta
-	sed -i -e 's/line 4/line 4a/' $testroot/wt/epsilon/zeta
-	sed -i -e 's/line 6/line 6a/' $testroot/wt/epsilon/zeta
+	ed -s $testroot/wt/epsilon/zeta <<-\EOF
+	,s/line 0/line 0a/
+	,s/line 4/line 4a/
+	,s/line 6/line 6a/
+	w
+	EOF
 
 	# stage line 0 and line 6
 	printf "y\n" > $testroot/patchscript