1#!/usr/bin/env bash
2
3# Copyright 2016 The Fuchsia Authors
4#
5# Use of this source code is governed by a MIT-style
6# license that can be found in the LICENSE file or at
7# https://opensource.org/licenses/MIT
8
9# Use this script to bisect a regression using the prebuilt zircon kernel images. The arguments to
10# this script are passed to 'git bisect start'
11
12set -e
13
14readonly DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
15
16# During the bisect git will change the working tree including the bisect script, so make a copy of
17# it in a temporary location first.
18readonly TEMP_DIR="$(mktemp -d)"
19trap "rm -rf ${TEMP_DIR}" EXIT
20cp "${DIR}/bisect-helper-x64" "${TEMP_DIR}"
21git bisect start $@
22git bisect run "${TEMP_DIR}/bisect-helper-x64" "${DIR}"
23