Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions tools/lintdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ def main():
if gitroot:
os.chdir(gitroot[0])

# Resolve the merge base between the ref and HEAD so that we only lint
# files changed on this branch, not files that changed on the ref since
# the branch point.
merge_base = parse_lines(["git", "merge-base", args.ref, "HEAD"])
base = merge_base[0] if merge_base else args.ref

changed = parse_lines(["git", "diff", "--name-only", base, "--", "."])
# Diff the merge base against the working tree so we only lint files changed
# on this branch, not files that advanced on the ref since the branch point.
# Unlike testmask's three-dot "ref...HEAD" form (tools/testmask/git.go), this
# includes the dirty tree's uncommitted changes, which is the point of --fix.
changed = parse_lines(["git", "diff", "--name-only", "--merge-base", args.ref, "--", "."])

cmd = args.args[:]

Expand Down
Loading