]> git.droids-corp.org - git-central.git/commitdiff
Auto-deploy files other than config and hooks.
authorStephen Haberman <stephen@exigencecorp.com>
Thu, 13 Nov 2008 04:37:50 +0000 (22:37 -0600)
committerStephen Haberman <stephen@exigencecorp.com>
Thu, 13 Nov 2008 04:37:50 +0000 (22:37 -0600)
server/post-receive-gitconfig
tests/t2800-post-receive-gitconfig.sh

index 46ab3e4df164359c87a0402a769c14d7910b7c99..98dab4ae82cf9f82b30dd8553c25f2724c4cbc6a 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/sh
 #
+# Copyright (c) 2008 Stephen Haberman
+#
 # Auto-deploys the contents of the gitconfig branch to $GIT_DIR.
 #
 # The config file is handled specially--instead of the $GIT_DIR's config file
@@ -30,6 +32,11 @@ while read oldrev newrev refname ; do
                                git cat-file blob "$file_hash" > "hooks/$file_name"
                        done
                fi
+
+               git ls-tree $newrev | grep -v hooks | grep -v config | grep blob | while read mode type file_hash file_name ; do
+                       echo "Installing $file_name"
+                       git cat-file blob "$file_hash" > "$file_name"
+               done
        fi
 done
 
index 75eae1f2f793c00eb5de39e924f229770ff03f61..6933fc840106d56c95b350035d14a8b3b49f8390 100644 (file)
@@ -34,5 +34,17 @@ test_expect_success 'pushing initial value works' '
        cd ..
 '
 
+test_expect_success 'pushing locked works' '
+       ! test -f server/.git/locked &&
+
+       git checkout gitconfig &&
+       echo "foo" > locked &&
+       git add locked &&
+       git commit -m "Add locked"
+       git push origin gitconfig
+
+       test -f server/.git/locked
+'
+
 test_done