1#!/bin/sh
   2#
   3# Copyright (c) 2005 Junio C Hamano
   4#
   5test_description='git apply symlinks and partial files
   7'
   9. ./test-lib.sh
  11test_expect_success setup '
  13        test_ln_s_add path1/path2/path3/path4/path5 link1 &&
  15        git commit -m initial &&
  16        git branch side &&
  18        rm -f link? &&
  20        test_ln_s_add htap6 link1 &&
  22        git commit -m second &&
  23        git diff-tree -p HEAD^ HEAD >patch  &&
  25        git apply --stat --summary patch
  26'
  28test_expect_success SYMLINKS 'apply symlink patch' '
  30        git checkout side &&
  32        git apply patch &&
  33        git diff-files -p >patched &&
  34        test_cmp patch patched
  35'
  37test_expect_success 'apply --index symlink patch' '
  39        git checkout -f side &&
  41        git apply --index patch &&
  42        git diff-index --cached -p HEAD >patched &&
  43        test_cmp patch patched
  44'
  46test_done