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 SYMLINKS setup '
  13        ln -s path1/path2/path3/path4/path5 link1 &&
  15        git add link? &&
  16        git commit -m initial &&
  17        git branch side &&
  19        rm -f link? &&
  21        ln -s htap6 link1 &&
  23        git update-index link? &&
  24        git commit -m second &&
  25        git diff-tree -p HEAD^ HEAD >patch  &&
  27        git apply --stat --summary patch
  28'
  30test_expect_success SYMLINKS 'apply symlink patch' '
  32        git checkout side &&
  34        git apply patch &&
  35        git diff-files -p >patched &&
  36        test_cmp patch patched
  37'
  39test_expect_success SYMLINKS 'apply --index symlink patch' '
  41        git checkout -f side &&
  43        git apply --index patch &&
  44        git diff-index --cached -p HEAD >patched &&
  45        test_cmp patch patched
  46'
  48test_done