From b3a6a6918f020a4c010c5e94ca25a52f3105d13b Mon Sep 17 00:00:00 2001
From: Jan Vales <jan@jvales.net>
Date: Wed, 13 Jul 2016 22:19:52 +0200
Subject: [PATCH] rename .git and .gitignore to temp. disable git submodule
 system.

---
 vmsnap.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vmsnap.sh b/vmsnap.sh
index de38e35..8c1483e 100755
--- a/vmsnap.sh
+++ b/vmsnap.sh
@@ -31,6 +31,10 @@ if [ ! -d ".git" ]; then
   git tag InitialCommit
 fi
 
+echo "(temp) renaming .git and .gitignore to prevent detection"
+find root -type d -name '.git' -exec mv -v {} {}.vmdiff.nogitdetect \; 2>/dev/null
+find root -name '.gitignore' -exec mv -v {} {}.vmdiff.nogitdetect \;
+
 echo "storing file owner + permissions..."
 find root -not -type l -print0 | sort -z | xargs -0 -n1 stat --printf="chown %u:%g\t\"%n\"; chmod %a \"%n\"\n" > setPerms.sh
 
@@ -38,5 +42,9 @@ echo "storing filesystem into git..."
 git add setPerms.sh root
 git commit -a -m "vm snapshot: $1"
 
+echo "(temp) restoring .git and .gitignore"
+find root -type d -name '.git.vmdiff.nogitdetect' -exec rename -v 's/.vmdiff.nogitdetect$//' "{}" \; 2>/dev/null
+find root -name '.gitignore.vmdiff.nogitdetect' -exec rename -v 's/.vmdiff.nogitdetect$//' "{}" \; 
+
 echo "DONE"
 
-- 
2.43.0