1#!/bin/sh
   2test_description='pull can handle submodules'
   4. ./test-lib.sh
   6. "$TEST_DIRECTORY"/lib-submodule-update.sh
   7reset_branch_to_HEAD () {
   9        git branch -D "$1" &&
  10        git checkout -b "$1" HEAD &&
  11        git branch --set-upstream-to="origin/$1" "$1"
  12}
  13git_pull () {
  15        reset_branch_to_HEAD "$1" &&
  16        git pull
  17}
  18# pulls without conflicts
  20test_submodule_switch "git_pull"
  21git_pull_ff () {
  23        reset_branch_to_HEAD "$1" &&
  24        git pull --ff
  25}
  26test_submodule_switch "git_pull_ff"
  28git_pull_ff_only () {
  30        reset_branch_to_HEAD "$1" &&
  31        git pull --ff-only
  32}
  33test_submodule_switch "git_pull_ff_only"
  35git_pull_noff () {
  37        reset_branch_to_HEAD "$1" &&
  38        git pull --no-ff
  39}
  40KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
  42KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
  43test_submodule_switch "git_pull_noff"
  44test_done