]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script/clean-ci: do not push if there is nothing to delete
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 11 Feb 2025 16:06:33 +0000 (11:06 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Tue, 11 Feb 2025 16:06:33 +0000 (11:06 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/script/clean-ci

index d5df15a0b6548b501cb657161f506353cd43edea..5a2b84c8493ce42b8b43e4de571f94e9a3d734d7 100755 (executable)
@@ -19,11 +19,13 @@ function eprintf {
 
 
 function delete_refs {
-    if [[ DRY_RUN -eq 0 ]]; then
-        eprintf 'Deleting refs: %s' "$*"
-        git push --quiet "$CEPH_CI" --delete "$@"
-    else
-        eprintf 'Would delete refs: %s' "$*"
+    if [[ ${#TO_DELETE[@]} -gt 0 ]]; then
+        if [[ DRY_RUN -eq 0 ]]; then
+            eprintf 'Deleting refs: %s' "$*"
+            git push --quiet "$REMOTE" --delete "$@"
+        else
+            eprintf 'Would delete refs: %s' "$*"
+        fi
     fi
 }