summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/git-hooks/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-09-10 17:32:31 +0200
committermakefu <github@syntax-fehler.de>2018-09-10 17:32:31 +0200
commit859f98583788a9324be0e8c52d36a6bb812273fe (patch)
tree81e1ce4bd2a4185221761165023434f8737fff06 /krebs/5pkgs/simple/git-hooks/default.nix
parentb2a3bd38ea70307c8b136eba42de7cc882afd441 (diff)
parentf6e69c6ecb25fc96655ec1749747d9ccb7880365 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/git-hooks/default.nix')
-rw-r--r--krebs/5pkgs/simple/git-hooks/default.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix
index 1930c7f14..0a2c84410 100644
--- a/krebs/5pkgs/simple/git-hooks/default.nix
+++ b/krebs/5pkgs/simple/git-hooks/default.nix
@@ -6,11 +6,11 @@ with import <stockholm/lib>;
# TODO irc-announce should return a derivation
# but it cannot because krebs.git.repos.*.hooks :: attrsOf str
irc-announce =
- { branches ? []
- , cgit_endpoint ? "http://cgit.${nick}.r"
+ { cgit_endpoint ? "http://cgit.${nick}.r"
, channel
, nick
, port ? 6667
+ , refs ? []
, server
, verbose ? false
}: /* sh */ ''
@@ -57,14 +57,15 @@ with import <stockholm/lib>;
receive_mode=non-fast-forward
fi
- h=$(echo $ref | sed 's:^refs/heads/::')
-
- ${optionalString (branches != []) ''
- if ! (echo "$h" | grep -qE "${concatStringsSep "|" branches}"); then
- echo "we are not serving this branch: $h"
+ ${optionalString (refs != []) ''
+ if ! { echo "$ref" | grep -qE "${concatStringsSep "|" refs}"; }; then
+ echo "we are not announcing this ref: $h"
exit 0
fi
''}
+
+ h=$(echo $ref | sed 's:^refs/heads/::')
+
# empty_tree=$(git hash-object -t tree /dev/null)
empty_tree=4b825dc6