aboutsummaryrefslogtreecommitdiff
path: root/infra/bisector.py
diff options
context:
space:
mode:
authorOliver Chang <oliverchang@users.noreply.github.com>2020-05-07 17:19:57 +1000
committerGitHub <noreply@github.com>2020-05-07 17:19:57 +1000
commitaf766f3f2c64023de98d008dc9b6061510bf714c (patch)
treeef7c3e6a7f54519256d8d36150dccd54a8cf4326 /infra/bisector.py
parent191b4f6009b066363de22553c269c3a11e717f16 (diff)
downloadoss-fuzz-af766f3f2c64023de98d008dc9b6061510bf714c.tar.gz
bisector: always reset projects/ even when we exception out. (#3769)
Diffstat (limited to 'infra/bisector.py')
-rw-r--r--infra/bisector.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/infra/bisector.py b/infra/bisector.py
index 8a5b78a1e..4e88bd8e4 100644
--- a/infra/bisector.py
+++ b/infra/bisector.py
@@ -296,16 +296,15 @@ def bisect(bisect_type, old_commit, new_commit, test_case_path, fuzz_target,
Raises:
ValueError: when a repo url can't be determine from the project.
"""
- result = _bisect(bisect_type, old_commit, new_commit, test_case_path,
+ try:
+ return _bisect(bisect_type, old_commit, new_commit, test_case_path,
fuzz_target, build_data)
-
- # Clean up projects/ as _bisect may have modified it.
- oss_fuzz_repo_manager = repo_manager.BaseRepoManager(helper.OSS_FUZZ_DIR)
- oss_fuzz_repo_manager.git(['reset', 'projects'])
- oss_fuzz_repo_manager.git(['checkout', 'projects'])
- oss_fuzz_repo_manager.git(['clean', '-fxd', 'projects'])
-
- return result
+ finally:
+ # Clean up projects/ as _bisect may have modified it.
+ oss_fuzz_repo_manager = repo_manager.BaseRepoManager(helper.OSS_FUZZ_DIR)
+ oss_fuzz_repo_manager.git(['reset', 'projects'])
+ oss_fuzz_repo_manager.git(['checkout', 'projects'])
+ oss_fuzz_repo_manager.git(['clean', '-fxd', 'projects'])
if __name__ == '__main__':