diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-19 08:14:41 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-19 08:16:34 +0000 |
commit | 7a3a4b9d310876f68f4ba788afaef77ad15fc62b (patch) | |
tree | e9d12c733cbc51cfb8499f09ff60cda23999662b /t/v2writable.t | |
parent | cf1e5bcfeacd5b2a3b8e82052a65e69cd1e0cc57 (diff) | |
download | public-inbox-7a3a4b9d310876f68f4ba788afaef77ad15fc62b.tar.gz |
This makes it easier to audit deletes with "git log -p" and prevents an unstable specification of "content_id" from being stored in history. This should be cost-free if done in the same partition (and even cheaper than before as it introduces no new blobs). It does have a higher cost across partitions, but is probably irrelevant given the typical ham:spam ratio.
Diffstat (limited to 't/v2writable.t')
-rw-r--r-- | t/v2writable.t | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/v2writable.t b/t/v2writable.t index 6e37b722..a5c982e9 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -191,6 +191,7 @@ EOF { local $ENV{NPROC} = 2; my @before = $git0->qx(qw(log --pretty=oneline)); + my $before = $git0->qx(qw(log --pretty=raw --raw -r --no-abbrev)); $im = PublicInbox::V2Writable->new($ibx, 1); is($im->{partitions}, 1, 'detected single partition from previous'); my $smsg = $im->remove($mime, 'test removal'); @@ -207,6 +208,14 @@ EOF my @found = (); $srch->each_smsg_by_mid($smsg->mid, sub { push @found, @_; 1 }); is(scalar(@found), 0, 'no longer found in Xapian skeleton'); + + my $after = $git0->qx(qw(log -1 --pretty=raw --raw -r --no-abbrev)); + if ($after =~ m!( [a-f0-9]+ )A\td$!) { + my $oid = $1; + ok(index($before, $oid) > 0, 'no new blob introduced'); + } else { + fail('failed to extract blob from log output'); + } } done_testing(); |