merge(3p/git): Merge git subtree at v2.29.2
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
This commit is contained in:
parent
082c006c04
commit
f4609b896f
1485 changed files with 241535 additions and 109418 deletions
12
third_party/git/t/t9700/test.pl
vendored
12
third_party/git/t/t9700/test.pl
vendored
|
|
@ -23,6 +23,8 @@ sub adjust_dirsep {
|
|||
return $path;
|
||||
}
|
||||
|
||||
my $oid_re = qr/^[0-9a-fA-F]{40}(?:[0-9a-fA-F]{24})?$/;
|
||||
|
||||
BEGIN { use_ok('Git') }
|
||||
|
||||
# set up
|
||||
|
|
@ -59,15 +61,15 @@ ok($@, "config_bool: non-boolean values fail");
|
|||
open STDERR, ">&", $tmpstderr or die "cannot restore STDERR";
|
||||
|
||||
# ident
|
||||
like($r->ident("aUthor"), qr/^A U Thor <author\@example.com> [0-9]+ \+0000$/,
|
||||
like($r->ident("aUthor"), qr/^A U Thor <author\@example.com> [0-9]+ [+-]\d{4}$/,
|
||||
"ident scalar: author (type)");
|
||||
like($r->ident("cOmmitter"), qr/^C O Mitter <committer\@example.com> [0-9]+ \+0000$/,
|
||||
like($r->ident("cOmmitter"), qr/^C O Mitter <committer\@example.com> [0-9]+ [+-]\d{4}$/,
|
||||
"ident scalar: committer (type)");
|
||||
is($r->ident("invalid"), "invalid", "ident scalar: invalid ident string (no parsing)");
|
||||
my ($name, $email, $time_tz) = $r->ident('author');
|
||||
is_deeply([$name, $email], ["A U Thor", "author\@example.com"],
|
||||
"ident array: author");
|
||||
like($time_tz, qr/[0-9]+ \+0000/, "ident array: author");
|
||||
like($time_tz, qr/[0-9]+ [+-]\d{4}/, "ident array: author");
|
||||
is_deeply([$r->ident("Name <email> 123 +0000")], ["Name", "email", "123 +0000"],
|
||||
"ident array: ident string");
|
||||
is_deeply([$r->ident("invalid")], [], "ident array: invalid ident string");
|
||||
|
|
@ -93,7 +95,7 @@ is(Git::hash_object("blob", $tmpfile), $file1hash, "hash_object: roundtrip");
|
|||
open TEMPFILE, ">$tmpfile" or die "Can't open $tmpfile: $!";
|
||||
print TEMPFILE my $test_text = "test blob, to be inserted\n";
|
||||
close TEMPFILE or die "Failed writing to $tmpfile: $!";
|
||||
like(our $newhash = $r->hash_and_insert_object($tmpfile), qr/[0-9a-fA-F]{40}/,
|
||||
like(our $newhash = $r->hash_and_insert_object($tmpfile), $oid_re,
|
||||
"hash_and_insert_object: returns hash");
|
||||
open TEMPFILE, "+>$tmpfile" or die "Can't open $tmpfile: $!";
|
||||
is($r->cat_blob($newhash, \*TEMPFILE), length $test_text, "cat_blob: roundtrip size");
|
||||
|
|
@ -119,7 +121,7 @@ is($r2->wc_subdir, "directory2/", "wc_subdir initial (2)");
|
|||
|
||||
# commands in sub directory
|
||||
my $last_commit = $r2->command_oneline(qw(rev-parse --verify HEAD));
|
||||
like($last_commit, qr/^[0-9a-fA-F]{40}$/, 'rev-parse returned hash');
|
||||
like($last_commit, $oid_re, 'rev-parse returned hash');
|
||||
my $dir_commit = $r2->command_oneline('log', '-n1', '--pretty=format:%H', '.');
|
||||
isnt($last_commit, $dir_commit, 'log . does not show last commit');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue