From b86ecabf0d2d660f144ed013ea8961a247587c74 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 1 Jun 2024 16:50:30 +0200 Subject: fix(pkgs/git-cleanup): Don't quote the branches `git` cannot handle the branch names as single argument. --- pkgs/by-name/gi/git-cleanup/git-cleanup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pkgs/by-name/gi') 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 -- cgit 1.4.1