8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d1f8c8 commit 2ec46c9Copy full SHA for 2ec46c9
nox.py
@@ -96,11 +96,25 @@ def get_changed_files():
96
changed = subprocess.check_output(
97
['git', 'show', '--pretty=format:', '--name-only',
98
os.environ.get('TRAVIS_COMMIT')])
99
+
100
elif pr is not None:
- changed = subprocess.check_output(
101
- ['git', 'diff', '--name-only',
102
- os.environ.get('TRAVIS_COMMIT'),
103
- os.environ.get('TRAVIS_BRANCH')])
+ try:
+ changed = subprocess.check_output(
+ ['git', 'diff', '--name-only',
104
+ os.environ.get('TRAVIS_COMMIT'),
105
+ os.environ.get('TRAVIS_BRANCH')])
106
107
+ except subprocess.CalledProcessError:
108
+ # Fallback to git head.
109
+ git_head = subprocess.check_output(
110
+ ['git', 'rev-parse', 'HEAD']).strip()
111
112
+ print('Falling back to HEAD: {}'.format(git_head))
113
114
115
116
117
118
else:
119
changed = ''
120
print('Uh... where are we?')
0 commit comments