From 4132e288ba6af49cf726d71785ec1f2ff9f39270 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 18 Mar 2018 16:22:07 +0100 Subject: git-branch-list: Add `clear` command A new sub-command that clears the entire branch list. This makes it easy to remove everything when all the branches in the list are stale (e.g. everything's been merged already). --- t/100-clear-clears-all-branches-from-list.t | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 t/100-clear-clears-all-branches-from-list.t (limited to 't') diff --git a/t/100-clear-clears-all-branches-from-list.t b/t/100-clear-clears-all-branches-from-list.t new file mode 100644 index 0000000..952d68a --- /dev/null +++ b/t/100-clear-clears-all-branches-from-list.t @@ -0,0 +1,36 @@ +#!/usr/bin/env perl -w + +use strict; + +use Test::More; + +use File::Spec; + +my $BIN = File::Spec->rel2abs('git-branch-list'); + +chdir 't-git-repo' or die $!; + +system('git branch first'); +ok !$?; + +system("$BIN save first"); +ok !$?; + +system('git branch second'); +ok !$?; + +system("$BIN save second"); +ok !$?; + +system("$BIN clear"); +ok !$?; + +my $branch_list = qx($BIN); +is $branch_list, ''; + + +# Teardown +system('git branch -d first second'); + + +done_testing; -- cgit v1.2.3