t / interop / i5500-git-daemon.shon commit Merge branch 'js/fsmonitor-refresh-after-discarding-index' (cfd635c)
   1#!/bin/sh
   2
   3VERSION_A=.
   4VERSION_B=v1.0.0
   5
   6: ${LIB_GIT_DAEMON_PORT:=5500}
   7LIB_GIT_DAEMON_COMMAND='git.a daemon'
   8
   9test_description='clone and fetch by older client'
  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_A" '
  18        git.a init "$repo" &&
  19        git.a -C "$repo" commit --allow-empty -m one
  20'
  21
  22test_expect_success "clone with $VERSION_B" '
  23        git.b clone "$GIT_DAEMON_URL/repo" child &&
  24        echo one >expect &&
  25        git.a -C child log -1 --format=%s >actual &&
  26        test_cmp expect actual
  27'
  28
  29test_expect_success "fetch with $VERSION_B" '
  30        git.a -C "$repo" commit --allow-empty -m two &&
  31        (
  32                cd child &&
  33                git.b fetch
  34        ) &&
  35        echo two >expect &&
  36        git.a -C child log -1 --format=%s FETCH_HEAD >actual &&
  37        test_cmp expect actual
  38'
  39
  40test_done