aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTeddy Wing2019-05-25 11:34:04 +0200
committerTeddy Wing2019-05-25 11:34:04 +0200
commit18ec1361d4eea49066aa12ccb2b173f196962f66 (patch)
treec7cf270413a5366f41c6c2245860748fec0dff7d /t
parent94fcc86499cea2fc6c751a1b18d61f6cc6d3a7b9 (diff)
downloadgit-branch-list-18ec1361d4eea49066aa12ccb2b173f196962f66.tar.bz2
git-branch-list: Make the branch list work in subdirectories
When the current directory was not the Git root, the command wouldn't work. It expected to find the branch list database in the `.git` directory in the current directory. Make the program work even if the current directory is a subdirectory of the Git repository.
Diffstat (limited to 't')
-rw-r--r--t/105-list-works-in-subdirectory.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/105-list-works-in-subdirectory.t b/t/105-list-works-in-subdirectory.t
new file mode 100644
index 0000000..b236314
--- /dev/null
+++ b/t/105-list-works-in-subdirectory.t
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl -w
+
+use strict;
+
+use Test::More;
+
+use Bin qw($BIN);
+
+mkdir 't-git-repo/subdirectory', 0755;
+
+chdir 't-git-repo/subdirectory' or die $!;
+
+my $branch_list = qx($BIN);
+is $branch_list, '', 'must find database file';
+
+
+done_testing;