I read up online that git hook accepts 3 arguments:
the name of the ref being updated,
the old object name stored in the ref,
and the new object name to be stored in the ref.
I am trying to access these arguments but it's empty. What could be wrong here?
#!/bin/bash
echo $@
refname="$1"
oldrev="$2"
newrev="$3"
Based on the comments, I tried adding an echo statement echo "In update hook: Args:$@"
and heres the output that I see:
$git push
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 563 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 1 (delta 0)
remote: In update hook: Args:
remote:
remote: