зеркало из https://github.com/github/codeql.git
Codegen: prepend `.gitattributes` entries with `/`
This commit is contained in:
Родитель
436f2437ef
Коммит
95248d17d1
|
@ -194,8 +194,8 @@ class RenderManager(Renderer):
|
|||
def _dump_registry(self):
|
||||
self._registry_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(self._registry_path, 'w') as out, open(self._registry_path.parent / ".gitattributes", "w") as attrs:
|
||||
print(self._registry_path.name, "linguist-generated", file=attrs)
|
||||
print(".gitattributes", "linguist-generated", file=attrs)
|
||||
print(f"/{self._registry_path.name}", "linguist-generated", file=attrs)
|
||||
print("/.gitattributes", "linguist-generated", file=attrs)
|
||||
for f, hashes in sorted(self._hashes.items()):
|
||||
print(f, hashes.pre, hashes.post, file=out)
|
||||
print(f, "linguist-generated", file=attrs)
|
||||
print(f"/{f}", "linguist-generated", file=attrs)
|
||||
|
|
|
@ -46,7 +46,7 @@ def write_registry(file, *files_and_hashes):
|
|||
def assert_registry(file, *files_and_hashes):
|
||||
assert_file(file, create_registry(files_and_hashes))
|
||||
files = [file.name, ".gitattributes"] + [f for f, _, _ in files_and_hashes]
|
||||
assert_file(file.parent / ".gitattributes", "\n".join(f"{f} linguist-generated" for f in files) + "\n")
|
||||
assert_file(file.parent / ".gitattributes", "\n".join(f"/{f} linguist-generated" for f in files) + "\n")
|
||||
|
||||
|
||||
def hash(text):
|
||||
|
|
|
@ -1 +1 @@
|
|||
swift.dbscheme linguist-generated
|
||||
/swift.dbscheme linguist-generated
|
||||
|
|
Загрузка…
Ссылка в новой задаче