summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-06-23 15:10:01 +0000
committerRobert Speicher <robert@gitlab.com>2016-06-23 15:10:01 +0000
commitc5f2cffb1b1efe0bb017839308f6da6291d9d40a (patch)
treeb93deea979faf416deeb727a53736a83f46c9726
parentf2325a45c1ce4e6685f61a6e5d1ef0f351e34a18 (diff)
parentd5860f45ad21848bbbceeb3823fca2b2820d6cde (diff)
downloadgitlab-shell-c5f2cffb1b1efe0bb017839308f6da6291d9d40a.tar.gz
Merge branch 'no-argf' into 'master'
ARGF does more than we want ARGF is a virtual IO stream that treats the elements of ARGV as paths to files to be opened. In practice, git-receive-pack will probably never pass arguments to pre-receive and post-receive because it is not supposed to (according to 'man 5 githooks'). In case it does, however our hooks should not have the surprise behavior of treating those arguments as files to be opened. See merge request !66
-rwxr-xr-xhooks/post-receive2
-rwxr-xr-xhooks/pre-receive2
2 files changed, 2 insertions, 2 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index da0ff41..34802e5 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -3,7 +3,7 @@
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
-refs = ARGF.read
+refs = $stdin.read
key_id = ENV['GL_ID']
repo_path = Dir.pwd
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 7e23974..1f8a9d5 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -3,7 +3,7 @@
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
-refs = ARGF.read
+refs = $stdin.read
key_id = ENV['GL_ID']
repo_path = Dir.pwd