Chromium Code Reviews| Index: recipe_modules/git/api.py |
| diff --git a/recipe_modules/git/api.py b/recipe_modules/git/api.py |
| index 3832fc3779e7f52e4077969b310064fe13844c09..217dfe8100b0f431c047509b2aac1fc78ca04d4a 100644 |
| --- a/recipe_modules/git/api.py |
| +++ b/recipe_modules/git/api.py |
| @@ -140,7 +140,13 @@ class GitApi(recipe_api.RecipeApi): |
| file_name (str): optional path to a single file to checkout. |
| submodule_update_recursive (bool): if True, updates submodules |
| recursively. |
| + |
| + Returns: If set_got_revision is True and the checkout was successful, this |
|
dnj
2016/02/12 21:54:45
Why not always return it, even if set_got_revision
|
| + returns the commit hash of the checked-out-repo. Otherwise this returns |
| + None. |
| """ |
| + retVal = None |
| + |
| # TODO(robertocn): Break this function and refactor calls to it. |
| # The problem is that there are way too many unrealated use cases for |
| # it, and the function's signature is getting unwieldy and its body |
| @@ -256,6 +262,7 @@ class GitApi(recipe_api.RecipeApi): |
| if rev_parse_step.presentation.status == 'SUCCESS': |
| sha = rev_parse_step.stdout.strip() |
| + retVal = sha |
| rev_parse_step.presentation.properties['got_revision'] = sha |
| clean_args = list(itertools.chain( |
| @@ -281,6 +288,8 @@ class GitApi(recipe_api.RecipeApi): |
| cwd=dir_path, |
| can_fail_build=can_fail_build) |
| + return retVal |
| + |
| def get_timestamp(self, commit='HEAD', test_data=None, **kwargs): |
| """Find and return the timestamp of the given commit.""" |
| step_test_data = None |