]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Ensure we have a reference to the remote repository at sync-media
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Mar 2016 12:40:33 +0000 (09:40 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Mar 2016 12:40:33 +0000 (09:40 -0300)
files/sync-media

index 6864e2bc0888f8a654b3e73f128b6896e9b59a29..64e3f02cb0449aa6b35111b0b24c15102473c9e5 100644 (file)
@@ -106,6 +106,14 @@ if [ -d "$CACHE" ]; then
         find playlists -type d -exec sudo chmod 775 {} \;
       fi
 
+      # Ensure we have a reference to the remote repository
+      if [ -d "$VOLUME/$MEDIA/$folder/git/.annex" ]; then
+        # Check remote
+        if ! git remote | grep -q "^$REMOTE$"; then
+          git remote add $REMOTE $VOLUME/$MEDIA/$folder
+        fi
+      fi
+
       sync_media_identity
       sync_media_add
       git annex sync