| Index: recipe_modules/git/example.py
|
| diff --git a/recipe_modules/git/example.py b/recipe_modules/git/example.py
|
| index dc9fe0a8772dbb46fceabadc4ab42432e4b8677e..e86791863d12087430860b750d212b680c2a85f1 100644
|
| --- a/recipe_modules/git/example.py
|
| +++ b/recipe_modules/git/example.py
|
| @@ -26,18 +26,24 @@ def RunSteps(api):
|
| True)
|
|
|
| # You can use api.git.checkout to perform all the steps of a safe checkout.
|
| - api.git.checkout(
|
| + set_got_revision=api.properties.get('set_got_revision')
|
| + retVal = api.git.checkout(
|
| url,
|
| ref=api.properties.get('revision'),
|
| recursive=True,
|
| submodule_update_force=submodule_update_force,
|
| - set_got_revision=api.properties.get('set_got_revision'),
|
| + set_got_revision=set_got_revision,
|
| curl_trace_file=curl_trace_file,
|
| remote_name=api.properties.get('remote_name'),
|
| display_fetch_size=api.properties.get('display_fetch_size'),
|
| file_name=api.properties.get('checkout_file_name'),
|
| submodule_update_recursive=submodule_update_recursive)
|
|
|
| + if set_got_revision:
|
| + assert retVal == api.properties['expected_got_revision'], (
|
| + "expected retVal to be %r but was %r" % (
|
| + api.properties['expected_got_revision'], retVal))
|
| +
|
| # count_objects shows number and size of objects in .git dir.
|
| api.git.count_objects(
|
| name='count-objects',
|
| @@ -107,7 +113,10 @@ def GenTests(api):
|
|
|
| yield (
|
| api.test('set_got_revision') +
|
| - api.properties(set_got_revision=True) +
|
| + api.properties(
|
| + set_got_revision=True,
|
| + expected_got_revision="deadbeef",
|
| + ) +
|
| api.step_data('set got_revision',
|
| stdout=api.raw_io.output('deadbeef'))
|
| )
|
|
|