diff options
author | Adrian DC <radian.dc@gmail.com> | 2016-12-04 12:30:26 +0100 |
---|---|---|
committer | Adrian DC <radian.dc@gmail.com> | 2016-12-04 12:34:27 +0100 |
commit | ea2aaaeee4322b13eb1fd48342fc8f4a8109a83f (patch) | |
tree | fdd100ed6a67f95b0b5400fa2daabfc55b18279b | |
parent | 86152e68a701195a2269892561e67133961e51ac (diff) | |
download | build-ea2aaaeee4322b13eb1fd48342fc8f4a8109a83f.zip build-ea2aaaeee4322b13eb1fd48342fc8f4a8109a83f.tar.gz build-ea2aaaeee4322b13eb1fd48342fc8f4a8109a83f.tar.bz2 |
build: repopick: Avoid failing on commits lookup
* Some projects with multiple merges and
discountinuous histories could trigger
an error here when the HEAD~{?} does
not exist, hence avoid this by ignoring
the commit and continue the search
Change-Id: Ice28c87d1bf8897da52236b637bbb0c5d349f848
-rwxr-xr-x | tools/repopick.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/repopick.py b/tools/repopick.py index 9bf26bd..cfbb8a8 100755 --- a/tools/repopick.py +++ b/tools/repopick.py @@ -328,6 +328,8 @@ if __name__ == '__main__': # Check if change is already picked to HEAD...HEAD~check_picked_count found_change = False for i in range(0, check_picked_count): + if subprocess.call(['git', 'cat-file', '-e', 'HEAD~{0}'.format(i)], cwd=project_path, stderr=open(os.devnull, 'wb')): + continue output = subprocess.check_output(['git', 'show', '-q', 'HEAD~{0}'.format(i)], cwd=project_path).split() if 'Change-Id:' in output: head_change_id = '' |