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
Failed to extract signature
2 changed files with
1 additions and
9 deletions
-
tools/src/main/python/license-headers/check_license_headers.py
-
tools/src/main/python/license-headers/test_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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -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") |
|
|
|
|