]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
repo: add class for representing a code repo
authorEric Wong <e@80x24.org>
Fri, 10 Feb 2017 21:23:01 +0000 (21:23 +0000)
committerEric Wong <e@80x24.org>
Fri, 10 Feb 2017 21:23:01 +0000 (21:23 +0000)
This should hopefully allow us to organize our code better

MANIFEST
lib/PublicInbox/Repo.pm [new file with mode: 0644]
lib/PublicInbox/RepoConfig.pm

index a59d9dcc27bc60d5a08c0f6aa5990202d86e6492..bced28046e8787802e054e59f84b6fdd5b8e0d99 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -80,6 +80,7 @@ lib/PublicInbox/NewsWWW.pm
 lib/PublicInbox/ParentPipe.pm
 lib/PublicInbox/ProcessPipe.pm
 lib/PublicInbox/Qspawn.pm
+lib/PublicInbox/Repo.pm
 lib/PublicInbox/RepoBase.pm
 lib/PublicInbox/RepoConfig.pm
 lib/PublicInbox/RepoGit.pm
diff --git a/lib/PublicInbox/Repo.pm b/lib/PublicInbox/Repo.pm
new file mode 100644 (file)
index 0000000..812b107
--- /dev/null
@@ -0,0 +1,15 @@
+# Copyright (C) 2017 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+#
+# Represents a code repository, analoguos to the PublicInbox::Inbox
+# class for represpenting an inbox git repository.
+package PublicInbox::Repo;
+use strict;
+use warnings;
+
+sub new {
+       my ($class, $opts) = @_;
+       bless $opts, $class;
+}
+
+1;
index 323468525cc35ed4efe985c631849e4b58b3e1ce..7a1b316c8bc3eb2d33be18b6d9a615ec1e2871fd 100644 (file)
@@ -5,6 +5,7 @@ use strict;
 use warnings;
 use PublicInbox::Inbox;
 use PublicInbox::Config;
+use PublicInbox::Repo;
 require PublicInbox::Hval;
 
 sub new {
@@ -82,7 +83,7 @@ sub lookup {
 
        # of course git is the default VCS
        $rv->{vcs} ||= 'git';
-       $self->{-cache}->{$repo_path} = $rv;
+       $self->{-cache}->{$repo_path} = PublicInbox::Repo->new($rv);
 }
 
 1;