aboutsummaryrefslogtreecommitdiffstats
path: root/t/108-works-with-git-worktrees.t
blob: b2901c00b90c7189234f1ba5de7cb51dfd901b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;