| 1 | #!/bin/sh |
| 2 | |
| 3 | VERSION_A=. |
| 4 | VERSION_B=v1.0.0 |
| 5 | MAKE_OPTS_B="NO_OPENSSL=TooOld" |
| 6 | |
| 7 | : ${LIB_GIT_DAEMON_PORT:=5500} |
| 8 | LIB_GIT_DAEMON_COMMAND='git.a daemon' |
| 9 | |
| 10 | test_description='clone and fetch by older client' |
| 11 | . ./interop-lib.sh |
| 12 | . "$TEST_DIRECTORY"/lib-git-daemon.sh |
| 13 | |
| 14 | start_git_daemon --export-all |
| 15 | |
| 16 | repo=$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo |
| 17 | |
| 18 | test_expect_success "create repo served by $VERSION_A" ' |
| 19 | git.a init "$repo" && |
| 20 | git.a -C "$repo" commit --allow-empty -m one |
| 21 | ' |
| 22 | |
| 23 | test_expect_success "clone with $VERSION_B" ' |
| 24 | git.b clone "$GIT_DAEMON_URL/repo" child && |
| 25 | echo one >expect && |
| 26 | git.a -C child log -1 --format=%s >actual && |
| 27 | test_cmp expect actual |
| 28 | ' |
| 29 | |
| 30 | test_expect_success "fetch with $VERSION_B" ' |
| 31 | git.a -C "$repo" commit --allow-empty -m two && |
| 32 | ( |
| 33 | cd child && |
| 34 | git.b fetch |
| 35 | ) && |
| 36 | echo two >expect && |
| 37 | git.a -C child log -1 --format=%s FETCH_HEAD >actual && |
| 38 | test_cmp expect actual |
| 39 | ' |
| 40 | |
| 41 | test_done |