aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTeddy Wing2020-03-13 01:24:52 +0100
committerTeddy Wing2020-03-13 01:24:52 +0100
commitd57fed7924c986c617a18cb260b0a5bc0228cbb4 (patch)
treeaa8c40e014cb30a1b1384b01b336fed82ff524b8 /t
parent73b82527df51dc093455ae4149799c278c1dcffc (diff)
parent39ab4b571f331d42a8a3485e811e17dfaf72a930 (diff)
downloadgit-branch-list-master.tar.bz2
Merge branch 'make-branch-list-work-in-git-worktrees'HEADv0.1.4master
Diffstat (limited to 't')
-rw-r--r--t/108-works-with-git-worktrees.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/108-works-with-git-worktrees.t b/t/108-works-with-git-worktrees.t
new file mode 100644
index 0000000..b2901c0
--- /dev/null
+++ b/t/108-works-with-git-worktrees.t
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl -w
+
+use strict;
+
+use Test::More;
+use File::Path qw(remove_tree);
+
+use Bin qw($BIN);
+
+chdir 't-git-repo' or die $!;
+
+system('git branch a-branch');
+ok !$?;
+
+system("$BIN save a-branch");
+ok !$?;
+
+system('git worktree add ../t-git-repo-worktree');
+ok !$?;
+
+chdir '../t-git-repo-worktree' or die $!;
+
+my $branch_list = qx($BIN);
+is $branch_list, ' 1 a-branch
+';
+
+
+# Teardown
+system("$BIN clear");
+chdir '../t-git-repo' or die $!;
+remove_tree('../t-git-repo-worktree') or die $!;
+system('git checkout master');
+system('git branch -d a-branch');
+
+
+done_testing;