Merge pull request #208666 from figsoda/ts

vimPlugins: only commit nvim-treesitter updates when there are actually updates
This commit is contained in:
figsoda 2023-01-02 12:39:11 -05:00 committed by GitHub
commit f533ae34d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,11 +137,15 @@ def main():
subprocess.check_call([nvim_treesitter_dir.joinpath("update.py")])
if editor.nixpkgs_repo:
msg = "vimPlugins.nvim-treesitter: update grammars"
print(f"committing to nixpkgs: {msg}")
index = editor.nixpkgs_repo.index
index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))])
index.commit(msg)
for diff in index.diff(None):
if diff.a_path == "pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix":
msg = "vimPlugins.nvim-treesitter: update grammars"
print(f"committing to nixpkgs: {msg}")
index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))])
index.commit(msg)
return
print("no updates to nvim-treesitter grammars")
if __name__ == "__main__":