Fix infinite loop when FindRepoDir argument is a relative path.

This bug doesn't affect production but affects the unit tests.

BUG=chromium-os:9201
TEST=Confirmed this fixes an infinite loop in the unit tests, and that
    cbuildbot.py still works.

Change-Id: I1a56b92d8229110c84cebbe877e55fb99f053212

Review URL: http://codereview.chromium.org/5025002
This commit is contained in:
David James 2010-11-15 18:57:19 -08:00
parent f7502a6e03
commit d87170bb7b

View File

@ -146,6 +146,7 @@ def FindRepoDir(path=None):
""" """
if path is None: if path is None:
path = os.getcwd() path = os.getcwd()
path = os.path.abspath(path)
while path != '/': while path != '/':
repo_dir = os.path.join(path, '.repo') repo_dir = os.path.join(path, '.repo')
if os.path.isdir(repo_dir): if os.path.isdir(repo_dir):