1#!/bin/sh
   2#
   3# Copyright (c) 2007 Johannes Sixt
   4#
   5test_description='git update-index on filesystem w/o symlinks test.
   7This tests that git update-index keeps the symbolic link property
   9even if a plain file is in the working tree if core.symlinks is false.'
  10. ./test-lib.sh
  12test_expect_success \
  14'preparation' '
  15git config core.symlinks false &&
  16l=$(printf file | git hash-object -t blob -w --stdin) &&
  17echo "120000 $l symlink" | git update-index --index-info'
  18test_expect_success \
  20'modify the symbolic link' '
  21printf new-file > symlink &&
  22git update-index symlink'
  23test_expect_success \
  25'the index entry must still be a symbolic link' '
  26case "`git ls-files --stage --cached symlink`" in
  27120000" "*symlink) echo pass;;
  28*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
  29esac'
  30test_done