tree-wide: deduplicate git identity

This commit is contained in:
Primrose 2025-11-02 16:43:48 +08:00
parent 432efd430c
commit 50db96001e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 73 additions and 127 deletions

View file

@ -0,0 +1,14 @@
let
hasconfigRemoteCondition = {
# Custom arguments
url,
path ? "*/**",
...
} @ cfg: let
cfg' = builtins.removeAttrs cfg ["url" "path"];
in [
(cfg' // {condition = "hasconfig:remote.*.url:git@${url}:${path}";})
(cfg' // {condition = "hasconfig:remote.*.url:https://${url}/${path}";})
];
in
builtins.concatMap hasconfigRemoteCondition