about summary refs log tree commit diff stats
path: root/pkgs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-06-01 16:50:30 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-06-01 16:50:30 +0200
commitb86ecabf0d2d660f144ed013ea8961a247587c74 (patch)
tree6be8708d7e1143ddac980eeeb8dbb79c0968aa4a /pkgs
parentfix(hardware): Disable udev rules for onlykey (diff)
downloadnixos-config-b86ecabf0d2d660f144ed013ea8961a247587c74.tar.gz
nixos-config-b86ecabf0d2d660f144ed013ea8961a247587c74.zip
fix(pkgs/git-cleanup): Don't quote the branches
`git` cannot handle the branch names as single argument.
Diffstat (limited to '')
-rwxr-xr-xpkgs/by-name/gi/git-cleanup/git-cleanup.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/by-name/gi/git-cleanup/git-cleanup.sh b/pkgs/by-name/gi/git-cleanup/git-cleanup.sh
index a6d8805a..f423a9d2 100755
--- a/pkgs/by-name/gi/git-cleanup/git-cleanup.sh
+++ b/pkgs/by-name/gi/git-cleanup/git-cleanup.sh
@@ -34,14 +34,20 @@ cleanup() {
 
     merged_branches="$(git branch --merged "$default_branch" --no-contains "$default_branch" --format='%(refname:short)')"
 
-    [ "$merged_branches" ] && git branch --delete "$merged_branches"
+    # shellcheck disable=2086
+    # We expect the branches to not contain spaces and want git to deal with them
+    # separately
+    [ "$merged_branches" ] && git branch --delete $merged_branches
 }
 cleanup_remote() {
     default_branch="$(get_default_branch)"
 
     merged_branches="$(git branch --remotes --merged "$default_branch" --no-contains "$default_branch" --format='%(refname:short)' | sed 's|origin/||')"
 
-    [ "$merged_branches" ] && git push --delete origin "$merged_branches"
+    # shellcheck disable=2086
+    # We expect the branches to not contain spaces and want git to deal with them
+    # separately
+    [ "$merged_branches" ] && git push --delete origin $merged_branches
 }
 
 remote=false