t / t6020-merge-df.shon commit bash: simple reimplementation of _get_comp_words_by_ref (dbda3b1)
   1#!/bin/sh
   2#
   3# Copyright (c) 2005 Fredrik Kuivinen
   4#
   5
   6test_description='Test merge with directory/file conflicts'
   7. ./test-lib.sh
   8
   9test_expect_success 'prepare repository' \
  10'echo "Hello" > init &&
  11git add init &&
  12git commit -m "Initial commit" &&
  13git branch B &&
  14mkdir dir &&
  15echo "foo" > dir/foo &&
  16git add dir/foo &&
  17git commit -m "File: dir/foo" &&
  18git checkout B &&
  19echo "file dir" > dir &&
  20git add dir &&
  21git commit -m "File: dir"'
  22
  23test_expect_code 1 'Merge with d/f conflicts' 'git merge "merge msg" B master'
  24
  25test_expect_failure 'F/D conflict' '
  26        git reset --hard &&
  27        git checkout master &&
  28        rm .git/index &&
  29
  30        mkdir before &&
  31        echo FILE >before/one &&
  32        echo FILE >after &&
  33        git add . &&
  34        git commit -m first &&
  35
  36        rm -f after &&
  37        git mv before after &&
  38        git commit -m move &&
  39
  40        git checkout -b para HEAD^ &&
  41        echo COMPLETELY ANOTHER FILE >another &&
  42        git add . &&
  43        git commit -m para &&
  44
  45        git merge master
  46'
  47
  48test_done