From 612f5198525d80b92eebd9e450b64b23363eee8e Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sun, 20 May 2012 17:52:38 -0600 Subject: Modify the tar parameters to exclude .git --- etc/phpshellsessions/gitsync | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'etc/phpshellsessions/gitsync') diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 8f0caac..6bc07e1 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -282,17 +282,12 @@ exec("rm -f ${CODIR}/pfSenseGITREPO/pfSenseGITREPO/etc/syslog.conf 2>/dev/null") echo "===> Installing new files...\n"; -// Don't include the .git directory in the copy -exec("mv $CODIR/pfSenseGITREPO/pfSenseGITREPO/.git $CODIR/pfSenseGITREPO/gitsync_temp.git"); - if($g['platform'] == "pfSense") - $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -Uxpf -)"; + $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - --exclude .git . | (cd / ; tar -Uxpf -)"; else - $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - . | (cd / ; tar -xpf -) 2>/dev/null"; + $command = "cd $CODIR/pfSenseGITREPO/pfSenseGITREPO ; tar -cpf - --exclude .git . | (cd / ; tar -xpf -) 2>/dev/null"; exec($command); -exec("mv $CODIR/pfSenseGITREPO/gitsync_temp.git $CODIR/pfSenseGITREPO/pfSenseGITREPO/.git"); - // Reset the repository to restore the deleted files exec("cd $CODIR/pfSenseGITREPO/pfSenseGITREPO && git reset --hard >/dev/null 2>/dev/null"); -- cgit v1.1