chomp(my $desc = try_cat("$git_dir/description"));
$owner = undef if $owner eq '';
$desc = 'Unnamed repository' if $desc eq '';
+ utf8::decode($desc);
+ utf8::decode($owner);
# templates/hooks--update.sample and git-multimail in git.git
# only match "Unnamed repository", not the full contents of
print $fh "https://example.com/inbox\n" or die;
close $fh or die;
open $fh, '>', "$x->{inboxdir}/description" or die;
- print $fh "blah\n" or die;
+ print $fh "\xc4\x80blah\n" or die;
close $fh or die;
}
is_deeply($x->cloneurl, ['https://example.com/inbox'], 'cloneurls update');
-is($x->description, 'blah', 'description updated');
+ok(utf8::valid($x->description), 'description is utf8::valid');
+is($x->description, "\x{100}blah", 'description updated');
is(unlink(glob("$x->{inboxdir}/*")), 2, 'unlinked cloneurl & description');
is_deeply($x->cloneurl, ['https://example.com/inbox'], 'cloneurls memoized');
-is($x->description, 'blah', 'description memoized');
+is($x->description, "\x{100}blah", 'description memoized');
done_testing();
unlike($tmp, qr/"modified":\s*"/, 'modified is an integer');
my $manifest = $json->decode($tmp);
ok(my $clone = $manifest->{'/alt'}, '/alt in manifest');
- is($clone->{owner}, 'lorelei', 'owner set');
+ is($clone->{owner}, "lorelei \x{100}", 'owner set');
is($clone->{reference}, '/bare', 'reference detected');
is($clone->{description}, "we're all clones", 'description read');
ok(my $bare = $manifest->{'/bare'}, '/bare in manifest');
open $fh, '>', "$alt/description" or die;
print $fh "we're all clones\n" or die;
close $fh or die;
- is(xsys('git', "--git-dir=$alt", qw(config gitweb.owner lorelei)), 0,
+ is(xsys('git', "--git-dir=$alt", qw(config gitweb.owner),
+ "lorelei \xc4\x80"), 0,
'set gitweb user');
ok(unlink("$bare->{git_dir}/description"), 'removed bare/description');
open $fh, '>', $cfgfile or die;