Skip to contentSkip to conversation

Fix t5510-fetch's use of sed

PATCH In review Shawn O. Pearce 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 Fix t5510-fetch's use of sed

POSIX says sed may add a trailing LF if there isn't already one there. We shouldn't rely on it not adding that LF, as some systems (Mac OS X for example) will add it.

---
 t/t5510-fetch.sh |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
t/t5510-fetch.sh +7 -1
index ee3f397..426017e 100755
@@ -134,7 +134,13 @@ test_expect_success 'bundle does not prerequisite objects' '
 	git add file2 &&
 	git commit -m add.file2 file2 &&
 	git bundle create bundle3 -1 HEAD &&
-	sed "1,4d" < bundle3 > bundle.pack &&
+	(
+		while read x && test -n "$x"
+		do
+			:;
+		done
+		cat
+	) <bundle3 >bundle.pack &&
 	git index-pack bundle.pack &&
 	test 4 = $(git verify-pack -v bundle.pack | wc -l)
 '
Signature · 1 line
1.5.0.3.985.gcf0b4
#1 lore raw

Hi,

Quoted 5 lines · Shawn O. Pearce

POSIX says sed may add a trailing LF if there isn't already one there. We shouldn't rely on it not adding that LF, as some systems (Mac OS X for example) will add it.

ACK!

Ciao,
Dscho