@matheusbsbs / matheus-bagliano / commits / e23cb8c0cc
Fork 0

git-bisect: war on "sed"

We do not need to pipe "echo" to "sed" only to strip refs/heads/ from the beginning. We are assuming not-so-ancient shells these days. Also there is no need to avoid assuming \012 is the LF; we do not run on EBCDIC, sorry. Other parts of the script already uses tr to convert separator to LF that way. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 15, 2007 at 00:39 UTC e23cb8c0cc0fb9f18e7e7106e2eec692a7b10044
1 file changed +2 -3
git-bisect.sh
+2 -3
@@ -71,7 +71,7 @@ bisect_start() {
71 ;;
72 refs/heads/*)
73 [ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
74 - echo "$head" | sed 's#^refs/heads/##' >"$GIT_DIR/head-name"
74 + echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
75 ;;
76 *)
77 die "Bad HEAD - strange symbolic ref"
@@ -275,8 +275,7 @@ exit_if_skipped_commits () {
275 if expr "$_tried" : ".*[|].*" > /dev/null ; then
276 echo "There are only 'skip'ped commit left to test."
277 echo "The first bad commit could be any of:"
278 - echo "$_tried" | sed -e 's/[|]/\
279 -/g'
278 + echo "$_tried" | tr '[|]' '[\012]'
279 echo "We cannot bisect more!"
280 exit 2
281 fi