summaryrefslogtreecommitdiff
path: root/usr/src/tools/scripts/git-pbchk.py
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2018-10-04 15:50:56 +0100
committerDan McDonald <danmcd@joyent.com>2018-10-16 11:19:46 -0400
commit38e36c53e77317894c59b3460770bf73f6707578 (patch)
tree5144ff6effa7b351b8646fe80fba909946b0f137 /usr/src/tools/scripts/git-pbchk.py
parent96c8483a3fb53529bbf410957b0ad69cfb5d9229 (diff)
downloadillumos-joyent-38e36c53e77317894c59b3460770bf73f6707578.tar.gz
9867 pbchk exception_lists only work from top srcdir
Reviewed by: Yuri Pankov <yuripv@yuripv.net> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/tools/scripts/git-pbchk.py')
-rw-r--r--usr/src/tools/scripts/git-pbchk.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py
index 2a05473dae..0d3fc89f1e 100644
--- a/usr/src/tools/scripts/git-pbchk.py
+++ b/usr/src/tools/scripts/git-pbchk.py
@@ -198,20 +198,21 @@ def gen_files(root, parent, paths, exclude):
if not select:
select = lambda x: True
- for f in git_file_list(parent, paths):
- f = relpath(f, '.')
+ for abspath in git_file_list(parent, paths):
+ path = relpath(abspath, '.')
try:
- res = git("diff %s HEAD %s" % (parent, f))
+ res = git("diff %s HEAD %s" % (parent, path))
except GitError, e:
- # This ignores all the errors that can be thrown. Usually, this means
- # that git returned non-zero because the file doesn't exist, but it
- # could also fail if git can't create a new file or it can't be
- # executed. Such errors are 1) unlikely, and 2) will be caught by other
- # invocations of git().
+ # This ignores all the errors that can be thrown. Usually, this
+ # means that git returned non-zero because the file doesn't
+ # exist, but it could also fail if git can't create a new file
+ # or it can't be executed. Such errors are 1) unlikely, and 2)
+ # will be caught by other invocations of git().
continue
empty = not res.readline()
- if (os.path.isfile(f) and not empty and select(f) and not exclude(f)):
- yield f
+ if (os.path.isfile(path) and not empty and
+ select(path) and not exclude(abspath)):
+ yield path
return ret