t / t6025-merge-symlinks.shon commit Add tests for documented features of "git reset". (359048d)
   1#!/bin/sh
   2#
   3# Copyright (c) 2007 Johannes Sixt
   4#
   5
   6test_description='merging symlinks on filesystem w/o symlink support.
   7
   8This tests that git-merge-recursive writes merge results as plain files
   9if core.symlinks is false.'
  10
  11. ./test-lib.sh
  12
  13test_expect_success \
  14'setup' '
  15git config core.symlinks false &&
  16> file &&
  17git add file &&
  18git-commit -m initial &&
  19git branch b-symlink &&
  20git branch b-file &&
  21l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
  22echo "120000 $l symlink" | git update-index --index-info &&
  23git-commit -m master &&
  24git-checkout b-symlink &&
  25l=$(echo -n file-different | git-hash-object -t blob -w --stdin) &&
  26echo "120000 $l symlink" | git update-index --index-info &&
  27git-commit -m b-symlink &&
  28git-checkout b-file &&
  29echo plain-file > symlink &&
  30git add symlink &&
  31git-commit -m b-file'
  32
  33test_expect_failure \
  34'merge master into b-symlink, which has a different symbolic link' '
  35! git-checkout b-symlink ||
  36git-merge master'
  37
  38test_expect_success \
  39'the merge result must be a file' '
  40test -f symlink'
  41
  42test_expect_failure \
  43'merge master into b-file, which has a file instead of a symbolic link' '
  44! (git-reset --hard &&
  45git-checkout b-file) ||
  46git-merge master'
  47
  48test_expect_success \
  49'the merge result must be a file' '
  50test -f symlink'
  51
  52test_expect_failure \
  53'merge b-file, which has a file instead of a symbolic link, into master' '
  54! (git-reset --hard &&
  55git-checkout master) ||
  56git-merge b-file'
  57
  58test_expect_success \
  59'the merge result must be a file' '
  60test -f symlink'
  61
  62test_done