diff options
author | Vincent Ambo <mail@tazj.in> | 2020-11-21T18·20+0100 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2020-11-21T18·45+0100 |
commit | f4609b896fac842433bd495c166d5987852a6a73 (patch) | |
tree | 95511c465c54c4f5d27e5d39ce187e2a1dd82bd3 /third_party/git/t/lib-git-svn.sh | |
parent | 082c006c04343a78d87b6c6ab3608c25d6213c3f (diff) |
merge(3p/git): Merge git subtree at v2.29.2 r/1890
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
Diffstat (limited to 'third_party/git/t/lib-git-svn.sh')
-rw-r--r-- | third_party/git/t/lib-git-svn.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/third_party/git/t/lib-git-svn.sh b/third_party/git/t/lib-git-svn.sh index 5d4ae629e14e..547eb3c31a5a 100644 --- a/third_party/git/t/lib-git-svn.sh +++ b/third_party/git/t/lib-git-svn.sh @@ -69,7 +69,7 @@ svn_cmd () { maybe_start_httpd () { loc=${1-svn} - if git env--helper --type=bool --default=false --exit-code GIT_TEST_HTTPD + if test_bool_env GIT_TEST_SVN_HTTPD false then . "$TEST_DIRECTORY"/lib-httpd.sh LIB_HTTPD_SVN="$loc" @@ -78,21 +78,24 @@ maybe_start_httpd () { } convert_to_rev_db () { - perl -w -- - "$@" <<\EOF + perl -w -- - "$(test_oid rawsz)" "$@" <<\EOF use strict; +my $oidlen = shift; @ARGV == 2 or die "usage: convert_to_rev_db <input> <output>"; +my $record_size = $oidlen + 4; +my $hexlen = $oidlen * 2; open my $wr, '+>', $ARGV[1] or die "$!: couldn't open: $ARGV[1]"; open my $rd, '<', $ARGV[0] or die "$!: couldn't open: $ARGV[0]"; my $size = (stat($rd))[7]; -($size % 24) == 0 or die "Inconsistent size: $size"; -while (sysread($rd, my $buf, 24) == 24) { - my ($r, $c) = unpack('NH40', $buf); - my $offset = $r * 41; +($size % $record_size) == 0 or die "Inconsistent size: $size"; +while (sysread($rd, my $buf, $record_size) == $record_size) { + my ($r, $c) = unpack("NH$hexlen", $buf); + my $offset = $r * ($hexlen + 1); seek $wr, 0, 2 or die $!; my $pos = tell $wr; if ($pos < $offset) { - for (1 .. (($offset - $pos) / 41)) { - print $wr (('0' x 40),"\n") or die $!; + for (1 .. (($offset - $pos) / ($hexlen + 1))) { + print $wr (('0' x $hexlen),"\n") or die $!; } } seek $wr, $offset, 0 or die $!; @@ -104,7 +107,7 @@ EOF } require_svnserve () { - if ! git env--helper --type=bool --default=false --exit-code GIT_TEST_SVNSERVE + if ! test_bool_env GIT_TEST_SVNSERVE false then skip_all='skipping svnserve test. (set $GIT_TEST_SVNSERVE to enable)' test_done |