diff options
Diffstat (limited to '')
-rwxr-xr-x | pkgs/by-name/gi/git-cleanup/git-cleanup.sh | 10 |
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 |