diff options
author | Teddy Wing | 2019-05-25 11:45:10 +0200 |
---|---|---|
committer | Teddy Wing | 2019-05-25 11:45:10 +0200 |
commit | 33515f18b84997693baf1ca842f4297fb77edbd0 (patch) | |
tree | c7cf270413a5366f41c6c2245860748fec0dff7d | |
parent | 94fcc86499cea2fc6c751a1b18d61f6cc6d3a7b9 (diff) | |
parent | 18ec1361d4eea49066aa12ccb2b173f196962f66 (diff) | |
download | git-branch-list-33515f18b84997693baf1ca842f4297fb77edbd0.tar.bz2 |
Merge branch 'make-program-work-in-subdirectories'
-rwxr-xr-x | git-branch-list | 3 | ||||
-rw-r--r-- | t/105-list-works-in-subdirectory.t | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/git-branch-list b/git-branch-list index 13b3ed1..ed5ef34 100755 --- a/git-branch-list +++ b/git-branch-list @@ -18,7 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -DATABASE=.git/info/git-branch-list +GIT_ROOT=$(git rev-parse --show-toplevel) +DATABASE="${GIT_ROOT}/.git/info/git-branch-list" VERSION=0.1.1 function initialise_database () { 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; |