summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorChristopher Warrington <chwarr@microsoft.com>2020-05-07 21:29:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-08 17:54:27 (GMT)
commit6c722cbe5a919166eb0d7369762b09393eb5b518 (patch)
treeb9654b4a12e8576e8cfde9a570d433d44908166b /git-bisect.sh
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
downloadgit-6c722cbe5a919166eb0d7369762b09393eb5b518.zip
git-6c722cbe5a919166eb0d7369762b09393eb5b518.tar.gz
git-6c722cbe5a919166eb0d7369762b09393eb5b518.tar.bz2
bisect: allow CRLF line endings in "git bisect replay" input
We advertise that the bisect log can be corrected in your editor before being fed to "git bisect replay", but some editors may turn the line endings to CRLF. Update the parser of the input lines so that the CR at the end of the line gets ignored. Were anyone to intentionally be using terms/revs with embedded CRs, replaying such bisects will no longer work with this change. I suspect that this is incredibly rare. Signed-off-by: Christopher Warrington <chwarr@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index efee12b..71b367a 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -209,6 +209,7 @@ bisect_replay () {
test "$#" -eq 1 || die "$(gettext "No logfile given")"
test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")"
git bisect--helper --bisect-reset || exit
+ oIFS="$IFS" IFS="$IFS$(printf '\015')"
while read git bisect command rev
do
test "$git $bisect" = "git bisect" || test "$git" = "git-bisect" || continue
@@ -232,6 +233,7 @@ bisect_replay () {
die "$(gettext "?? what are you talking about?")" ;;
esac
done <"$file"
+ IFS="$oIFS"
bisect_auto_next
}