Fix git hook to avoid the shell misinterpreting ^revision as a glob
authorTom Hughes <tom@compton.nu>
Mon, 21 Nov 2016 13:51:14 +0000 (13:51 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 21 Nov 2016 13:51:44 +0000 (13:51 +0000)
cookbooks/git/templates/default/post-receive.erb

index 52075a0..30ade27 100644 (file)
@@ -6,7 +6,7 @@ while read oldrev newrev refname
 do
   if [[ "$refname" = "refs/heads/master" ]]
   then
-    for rev in $(git rev-list ${newrev} ^${oldrev})
+    for rev in $(git rev-list ${oldrev}..${newrev})
     do
       sudo -u trac /usr/bin/trac-admin /var/lib/trac changeset added "<%= @repository %>" "${rev}"
     done