aboutsummaryrefslogtreecommitdiffstats
path: root/t/bin.pm
diff options
context:
space:
mode:
authorTeddy Wing2018-03-21 17:38:54 +0100
committerTeddy Wing2018-03-21 17:38:54 +0100
commit64fe9fc7fa4e073d6bb97cdee0d2914abb943391 (patch)
tree3ebd3ecfce83ce5da79e6c442b16c0becfada4fd /t/bin.pm
parent565c054f57248409eddc7ebe20629b85093f7c55 (diff)
downloadgit-branch-list-64fe9fc7fa4e073d6bb97cdee0d2914abb943391.tar.bz2
git-branch-list(drop): Add support for multiple branch arguments
Allow users to drop multiple branches in a single command. Instead of: $ git branch-list 1 $ git branch-list 3 $ git branch-list 4 you can now do: $ git branch-list 1 3 4 This makes it easier to drop a bunch of branches that you no longer need saved. drop_branch(): * No longer uses `branch_or_current_branch()`. Kept that function around because I didn't feel like touching the `save_branch()` code, and extracted the Git command to get the current branch to a new `current_branch()` function. * Used one loop to get branch names from IDs if necessary and feed these into a Bash array. A second loop just after deletes all branches in the branch array using the `sed` method from before. Didn't feel like changing the `sed` command so did it this way. That said, we're probably going to have to come back to it sooner or later because it's not going to be able to handle branch names containing slashes. main `case`: Change `drop_branch` call to pass it all command line arguments, except the 0th argument, which is the "drop" command (this is why we `shift` before calling the function). 101-drop-accepts-multiple-branch-arguments.t: Update test expectation which had an extra newline at the start of the string which isn't there in the real `git branch-list` output.
Diffstat (limited to 't/bin.pm')
0 files changed, 0 insertions, 0 deletions