[RFC PATCH v2 1/2] bisect: split out replay file parsing
- From
Adam Dinwoodie <adam@dinwoodie.org>
- Date
- Nov 20, 2017, 18:24 UTC
- Message-ID
- <e3bfd0ab1f7b17eb43cf50c91e17f498db56cdee.1511200589.git.adam@dinwoodie.org>
- In-Reply-To
- <cover.1511200589.git.adam@dinwoodie.org>
In order to allow a git bisect log file to be replayed without using all the surrounding code to do things like clean the repository state, split out the file-parsing part of bisect_replay into a separate function.
Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> --- git-bisect.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/git-bisect.sh b/git-bisect.sh index 54cbfecc5..895d7976a 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -422,6 +422,14 @@ bisect_replay () { test "$#" -eq 1 || die "$(gettext "No logfile given")" test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")" bisect_reset + bisect_replay_file "$file" + bisect_auto_next +} + +bisect_replay_file() { + file="$1" + test "$#" -eq 1 || die "$(gettext "No logfile given")" + test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")" while read git bisect command rev do test "$git $bisect" = "git bisect" || test "$git" = "git-bisect" || continue @@ -444,7 +452,6 @@ bisect_replay () { die "$(gettext "?? what are you talking about?")" ;; esac done <"$file" - bisect_auto_next } bisect_run () {
-- 2.15.0.281.g87c0a7615