(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <'fetching via git:// using core.gitproxy'>)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <'setup remote repo'>)} { (SQ <'\n'> <'\tgit init remote &&\n'> <'\t(cd remote &&\n'> <'\t echo content >file &&\n'> <'\t git add file &&\n'> <'\t git commit -m one\n'> <'\t)\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup proxy script'>)} { (SQ <'\n'> <'\twrite_script proxy-get-cmd "$PERL_PATH" <<-\\EOF &&\n'> <'\tread(STDIN, $buf, 4);\n'> <'\tmy $n = hex($buf) - 4;\n'> <'\tread(STDIN, $buf, $n);\n'> <'\tmy ($cmd, $other) = split /\\0/, $buf;\n'> <'\t# drop absolute-path on repo name\n'> <'\t$cmd =~ s{ /}{ };\n'> <'\tprint $cmd;\n'> <'\tEOF\n'> <'\n'> <'\twrite_script proxy <<-\\EOF\n'> <'\techo >&2 "proxying for $*"\n'> <'\tcmd=$(./proxy-get-cmd)\n'> <'\techo >&2 "Running $cmd"\n'> <'\texec $cmd\n'> <'\tEOF\n'> ) } ) (C {(test_expect_success)} {(SQ <'setup local repo'>)} { (SQ <'\n'> <'\tgit remote add fake git://example.com/remote &&\n'> <'\tgit config core.gitproxy ./proxy\n'> ) } ) (C {(test_expect_success)} {(SQ <'fetch through proxy works'>)} { (SQ <'\n'> <'\tgit fetch fake &&\n'> <'\techo one >expect &&\n'> <'\tgit log -1 --format=%s FETCH_HEAD >actual &&\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {(test_done)}) ] )