]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: sync-media:improved lock file handling (2)
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 27 Sep 2025 20:05:19 +0000 (17:05 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 27 Sep 2025 20:05:19 +0000 (17:05 -0300)
share/hydractl/sync-media

index b7840e5f6990712f7d89f313db5dfcd55f782e19..c8eed1237d02a0c1a68db76bd2a4321d1bfa504d 100755 (executable)
@@ -51,7 +51,8 @@ function sync_media_set_lockfile {
 function sync_media_unset_lockfile {
   if [ ! -z "$LOCKFILE" ]; then
     git annex unannex $LOCK
-    rm -f $LOCKFILE || echo "Could not remove lockfile $LOCKFILE"
+    git rm -f $LOCKFILE &> /dev/null || \
+      rm -f $LOCKFILE || echo "Could not remove lockfile $LOCKFILE"
   fi
 }