diff --git a/recipes/recipe_modules/gitiles/api.py b/recipes/recipe_modules/gitiles/api.py index 0f79dedd2..c99957067 100644 --- a/recipes/recipe_modules/gitiles/api.py +++ b/recipes/recipe_modules/gitiles/api.py @@ -137,4 +137,6 @@ class Gitiles(recipe_api.RecipeApi): fmt='text', add_json_log=False, **kwargs) + if step_result.json.output['value'] is None: + return None return base64.b64decode(step_result.json.output['value']) diff --git a/recipes/recipe_modules/gitiles/examples/full.py b/recipes/recipe_modules/gitiles/examples/full.py index 9dca3ce20..6a249e54c 100644 --- a/recipes/recipe_modules/gitiles/examples/full.py +++ b/recipes/recipe_modules/gitiles/examples/full.py @@ -4,6 +4,7 @@ DEPS = [ 'gitiles', + 'recipe_engine/json', 'recipe_engine/properties', ] @@ -62,6 +63,6 @@ def GenTests(api): ) + api.step_data( 'fetch master:NONEXISTENT', - api.gitiles.make_encoded_file('') + api.json.output({'value': None}) ) )