t / interop / i5700-protocol-transition.shon commit fsmonitor: update GIT_TEST_FSMONITOR support (4cb54d0)
   1#!/bin/sh
   2
   3VERSION_A=.
   4VERSION_B=v2.0.0
   5
   6: ${LIB_GIT_DAEMON_PORT:=5700}
   7LIB_GIT_DAEMON_COMMAND='git.b daemon'
   8
   9test_description='clone and fetch by client who is trying to use a new protocol'
  10. ./interop-lib.sh
  11. "$TEST_DIRECTORY"/lib-git-daemon.sh
  12
  13start_git_daemon --export-all
  14
  15repo=$GIT_DAEMON_DOCUMENT_ROOT_PATH/repo
  16
  17test_expect_success "create repo served by $VERSION_B" '
  18        git.b init "$repo" &&
  19        git.b -C "$repo" commit --allow-empty -m one
  20'
  21
  22test_expect_success "git:// clone with $VERSION_A and protocol v1" '
  23        GIT_TRACE_PACKET=1 git.a -c protocol.version=1 clone "$GIT_DAEMON_URL/repo" child 2>log &&
  24        git.a -C child log -1 --format=%s >actual &&
  25        git.b -C "$repo" log -1 --format=%s >expect &&
  26        test_cmp expect actual &&
  27        grep "version=1" log
  28'
  29
  30test_expect_success "git:// fetch with $VERSION_A and protocol v1" '
  31        git.b -C "$repo" commit --allow-empty -m two &&
  32        git.b -C "$repo" log -1 --format=%s >expect &&
  33
  34        GIT_TRACE_PACKET=1 git.a -C child -c protocol.version=1 fetch 2>log &&
  35        git.a -C child log -1 --format=%s FETCH_HEAD >actual &&
  36
  37        test_cmp expect actual &&
  38        grep "version=1" log &&
  39        ! grep "version 1" log
  40'
  41
  42stop_git_daemon
  43
  44test_expect_success "create repo served by $VERSION_B" '
  45        git.b init parent &&
  46        git.b -C parent commit --allow-empty -m one
  47'
  48
  49test_expect_success "file:// clone with $VERSION_A and protocol v1" '
  50        GIT_TRACE_PACKET=1 git.a -c protocol.version=1 clone --upload-pack="git.b upload-pack" parent child2 2>log &&
  51        git.a -C child2 log -1 --format=%s >actual &&
  52        git.b -C parent log -1 --format=%s >expect &&
  53        test_cmp expect actual &&
  54        ! grep "version 1" log
  55'
  56
  57test_expect_success "file:// fetch with $VERSION_A and protocol v1" '
  58        git.b -C parent commit --allow-empty -m two &&
  59        git.b -C parent log -1 --format=%s >expect &&
  60
  61        GIT_TRACE_PACKET=1 git.a -C child2 -c protocol.version=1 fetch --upload-pack="git.b upload-pack" 2>log &&
  62        git.a -C child2 log -1 --format=%s FETCH_HEAD >actual &&
  63
  64        test_cmp expect actual &&
  65        ! grep "version 1" log
  66'
  67
  68test_done