jasonmccreary / git-trim

MIT License
367 stars 10 forks source link

BUG: Too many arguments error when using -s flag #7

Closed the-dijkstra closed 2 years ago

the-dijkstra commented 2 years ago

Description

Running the command with stale flag results in an error git trim -s --dry-run

~/.oh-my-zsh/custom/plugins/git-trim/git-trim: line 230: [: too many arguments
~/.oh-my-zsh/custom/plugins/git-trim/git-trim: line 230: [: too many arguments
~/.oh-my-zsh/custom/plugins/git-trim/git-trim: line 230: [: too many arguments
~/.oh-my-zsh/custom/plugins/git-trim/git-trim: line 230: [: too many arguments
~/.oh-my-zsh/custom/plugins/git-trim/git-trim: line 230: [: too many arguments

Line in question:

if [ -z $(git log -1 -s --since="3 months ago" $branch) ]; then
jasonmccreary commented 2 years ago

Yeah, I think there's some variable expansion happening here. Are you using the latest script from main?

the-dijkstra commented 2 years ago

@jasonmccreary yes, I'm using the latest commit from main

jasonmccreary commented 2 years ago

This was actually part of a larger bug. Should be fixed in 06f8d76.

the-dijkstra commented 2 years ago

@jasonmccreary thanks working now.