From 1e0eef7ce0855794c1e488b3892d3cd6e5605154 Mon Sep 17 00:00:00 2001 From: Florian Ernst Date: Wed, 30 Oct 2013 10:42:51 +0100 Subject: [PATCH] fix bashism in git check-ref-format call 'system' spawns a default shell, and on many systems (e.g. Debian starting with 6.0 / Squeezy) the default shell isn't /bin/bash but /bin/dash instead. So let's only use POSIX features and drop the bash-specific '>&' shortcut. --- post-receive/dynamic-environments | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post-receive/dynamic-environments b/post-receive/dynamic-environments index a6e7206..ab0bd41 100755 --- a/post-receive/dynamic-environments +++ b/post-receive/dynamic-environments @@ -41,7 +41,7 @@ $stdin.each_line do |line| # Check if the branch name is valid. branchname = refname.sub(%r{^refs/heads/(.*$)}) { $1 } - unless system("git check-ref-format --branch '#{branchname}' >& /dev/null") + unless system("git check-ref-format --branch '#{branchname}' > /dev/null 2>&1") puts %Q{Branchname "#{branchname}" is not valid.} next end