From f03e4f1f3b4086a08c18b89513cb895453710b94 Mon Sep 17 00:00:00 2001
From: Dmitriy Safronov <zimniy@cyberbrain.pw>
Date: Wed, 16 Feb 2022 14:22:22 +0300
Subject: [PATCH] no hardcoded excludes (only from file)

---
 rsync-sync          | 3 +--
 rsync-sync.excludes | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/rsync-sync b/rsync-sync
index 7197bb5..3a34173 100644
--- a/rsync-sync
+++ b/rsync-sync
@@ -2,10 +2,9 @@
 
 rsync -a \
     --exclude-from='/rsync-sync.excludes' \
-    --exclude='/.git' \
     --delete-after \
     "${GIT_SYNC_ROOT:-/tmp/git}/${GIT_SYNC_DEST:-sync}/" \
-    /sync
+    /sync/
 
 if test -n "${RSYNC_SYNC_EXECHOOK_COMMAND}"; then
     /usr/bin/env sh "${RSYNC_SYNC_EXECHOOK_COMMAND}"
diff --git a/rsync-sync.excludes b/rsync-sync.excludes
index dd82fa5..329137f 100644
--- a/rsync-sync.excludes
+++ b/rsync-sync.excludes
@@ -1 +1,4 @@
 # Placeholder for your own excludes. Just mount your file into conteiner as /rsync-sync.excludes
+
+## Don't sync git repo directory
+/.git/
-- 
GitLab