Merge "Docs: use zuul:attr in secrets" into feature/zuulv3
diff --git a/doc/source/user/jobs.rst b/doc/source/user/jobs.rst
index f533f54..068da0b 100644
--- a/doc/source/user/jobs.rst
+++ b/doc/source/user/jobs.rst
@@ -278,14 +278,12 @@
**zuul.oldrev**
If the item was enqueued as the result of a tag being deleted, the
previous git sha of the tag will be included here. If the tag was
- created, this will be set to the value
- 0000000000000000000000000000000000000000.
+ created, this variable will be undefined.
**zuul.newrev**
If the item was enqueued as the result of a tag being created, the
new git sha of the tag will be included here. If the tag was
- deleted, this will be set to the value
- 0000000000000000000000000000000000000000.
+ deleted, this variable will be undefined.
Ref Items
+++++++++
@@ -298,14 +296,12 @@
**zuul.oldrev**
If the item was enqueued as the result of a ref being deleted, the
previous git sha of the ref will be included here. If the ref was
- created, this will be set to the value
- 0000000000000000000000000000000000000000.
+ created, this variable will be undefined.
**zuul.newrev**
If the item was enqueued as the result of a ref being created, the
new git sha of the ref will be included here. If the ref was
- deleted, this will be set to the value
- 0000000000000000000000000000000000000000.
+ deleted, this variable will be undefined.
Working Directory
+++++++++++++++++
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index cf70520..85ae68c 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -173,9 +173,11 @@
zuul_params['change'] = str(item.change.number)
if hasattr(item.change, 'patchset'):
zuul_params['patchset'] = str(item.change.patchset)
- if hasattr(item.change, 'oldrev') and item.change.oldrev:
+ if (hasattr(item.change, 'oldrev') and item.change.oldrev
+ and item.change.oldrev != '0' * 40):
zuul_params['oldrev'] = item.change.oldrev
- if hasattr(item.change, 'newrev') and item.change.newrev:
+ if (hasattr(item.change, 'newrev') and item.change.newrev
+ and item.change.newrev != '0' * 40):
zuul_params['newrev'] = item.change.newrev
zuul_params['items'] = []
for i in all_items: