Skip to content

Commit

Permalink
repopick: Avoid failing on commits lookup
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
AdrianDC authored and mikeNG committed Dec 10, 2016
1 parent 64fc5ae commit 13b02ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/tools/repopick.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ def fetch_query(remote_url, query):
# 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 = ''
Expand Down

0 comments on commit 13b02ff

Please sign in to comment.