diff options
author | Eric Wong <e@80x24.org> | 2023-04-19 21:54:48 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-04-20 18:22:55 +0000 |
commit | cbd13f06bf17357a9e160a6ae54a3f532e9eb068 (patch) | |
tree | b90607adbd26eccdafa656046c82d4d83767d9a4 /lib/PublicInbox/Git.pm | |
parent | c0d0d5b4131e5b18e0d5ae9877460204a8cd2f3c (diff) | |
download | public-inbox-cbd13f06bf17357a9e160a6ae54a3f532e9eb068.tar.gz |
This special support is only needed for --prune at the moment since the indexing side works on a per-repo basis. There's no automated tests, yet, but it seems to work well on my sha256 projects when sharing a cindex with sha1 projects.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r-- | lib/PublicInbox/Git.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 3108ed85..61ba8aa1 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -22,7 +22,9 @@ use IO::Poll qw(POLLIN); use Carp qw(croak carp); use PublicInbox::SHA (); use PublicInbox::DS qw(awaitpid); -our @EXPORT_OK = qw(git_unquote git_quote); +our %HEXLEN2SHA = (40 => 1, 64 => 256); +our %OFMT2HEXLEN = (sha1 => 40, sha256 => 64); +our @EXPORT_OK = qw(git_unquote git_quote %HEXLEN2SHA %OFMT2HEXLEN); our $PIPE_BUFSIZ = 65536; # Linux default our $in_cleanup; our $RDTIMEO = 60_000; # milliseconds |