line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Raw::Mempack; |
2
|
|
|
|
|
|
|
$Git::Raw::Mempack::VERSION = '0.90'; |
3
|
36
|
|
|
36
|
|
222
|
use strict; |
|
36
|
|
|
|
|
66
|
|
|
36
|
|
|
|
|
956
|
|
4
|
36
|
|
|
36
|
|
160
|
use warnings; |
|
36
|
|
|
|
|
59
|
|
|
36
|
|
|
|
|
781
|
|
5
|
|
|
|
|
|
|
|
6
|
36
|
|
|
36
|
|
154
|
use Git::Raw; |
|
36
|
|
|
|
|
66
|
|
|
36
|
|
|
|
|
1225
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Git::Raw::Mempack - Git in-memory object database class |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
version 0.90 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Git::Raw; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $mempack = Git::Raw::Mempack -> new; |
21
|
|
|
|
|
|
|
my $odb = $repo -> odb; |
22
|
|
|
|
|
|
|
$odb -> add_backend($mempack, 99); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Create blobs, trees and commits... |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Index the packfile and persist |
27
|
|
|
|
|
|
|
my $odb_path = catfile($repo -> path, 'objects'); |
28
|
|
|
|
|
|
|
my $tp = Git::Raw::TransferProgress -> new; |
29
|
|
|
|
|
|
|
my $indexer = Git::Raw::Indexer -> new($odb_path, $odb); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $pack = $mempack -> dump($repo); |
32
|
|
|
|
|
|
|
$indexer -> append($pack, $tp); |
33
|
|
|
|
|
|
|
$indexer -> commit($tp); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
A L represents a git in-memory object database. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new( ) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Create a new mempack backend. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 dump( $repo ) |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Dump all the queued in-memory writes to a packfile. Returns the contents of the |
49
|
|
|
|
|
|
|
packfile. It is the caller's responsibility to ensure that the generated |
50
|
|
|
|
|
|
|
packfile is available to the repository. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 reset( ) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Reset the mempack by clearing all the queued objects. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 AUTHOR |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Jacques Germishuys |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Copyright 2016 Jacques Germishuys. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
65
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
66
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; # End of Git::Raw::Mempack |