Browse Source

Revert "Fail the license header check when git merge-file errors"

This reverts commit aaabaa1b35.
pull/16654/head
Viacheslav Klimov 3 weeks ago
parent
commit
719ef7fe54
Failed to extract signature
  1. 2
      tools/src/main/python/license-headers/check_license_headers.py
  2. 8
      tools/src/main/python/license-headers/test_check_license_headers.py

2
tools/src/main/python/license-headers/check_license_headers.py

@ -231,7 +231,7 @@ def merged_ce_bases(repo, head, baseline):
def merge_blobs(repo, ours, base, theirs):
result = run(["git", "merge-file", "-p", "--object-id", ours, base, theirs], repo, ok=range(0, 128))
result = run(["git", "merge-file", "-p", "--object-id", ours, base, theirs], repo, ok=range(0, 256))
return result.stdout if result.returncode == 0 else None

8
tools/src/main/python/license-headers/test_check_license_headers.py

@ -663,14 +663,6 @@ class GitHistoryTests(unittest.TestCase):
self.assertEqual(b"ONE\ntwo\nthree\nfour\nFIVE\n", p.merge_blobs(git.root, ours, base, theirs))
self.assertIsNone(p.merge_blobs(git.root, ours, base, blob("uno\ntwo\nthree\nfour\nfive\n")))
def test_merge_blobs_fails_when_git_cannot_merge(self):
git = GitFixture(temporary_directory(self), "main")
git.write("File.java", "one\n")
git.commit("base")
blob = git("rev-parse", "HEAD:File.java")
with self.assertRaises(p.Failure):
p.merge_blobs(git.root, blob, blob, "no-such-object")
def test_ignore_filter_keeps_tracked_and_unignored_files(self):
repo = temporary_directory(self)
p.git(repo, "init")

Loading…
Cancel
Save