public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob 65667cfc32fb5a83e082d4290ac992b17d5c5202 865 bytes (raw)
name: t/git_idx.t 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
# Copyright (C) 2015 all contributors <meta@public-inbox.org>
# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
use strict;
use warnings;
use Test::More;
use File::Temp qw/tempdir/;
use Email::MIME;
my $tmpdir = tempdir('pi-git-idx-XXXXXX', TMPDIR => 1, CLEANUP => 1);
my $git_dir = "$tmpdir/a.git";
use_ok 'PublicInbox::Git';
use_ok 'PublicInbox::GitIdx';
my $git = PublicInbox::Git->new($git_dir);
is(0, system(qw(git init -q --bare), $git_dir), "git init (main)");

$git->qx(qw(config core.sharedRepository 0644));
is(git_umask_for($git_dir), oct '022', 'umask is correct for 644');

$git->qx(qw(config core.sharedRepository 0664));
is(git_umask_for($git_dir), oct '002', 'umask is correct for 664');

$git->qx(qw(config core.sharedRepository group));
is(git_umask_for($git_dir), oct '007', 'umask is correct for "group"');

done_testing();

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git