diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-01 16:50:30 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-06-01 16:50:30 +0200 |
commit | b86ecabf0d2d660f144ed013ea8961a247587c74 (patch) | |
tree | 6be8708d7e1143ddac980eeeb8dbb79c0968aa4a /pkgs | |
parent | fix(hardware): Disable udev rules for onlykey (diff) | |
download | nixos-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-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 |