t / t2102-update-index-symlinks.shon commit t5700-clone-reference: Quote $U (cb418b5)
   1#!/bin/sh
   2#
   3# Copyright (c) 2007 Johannes Sixt
   4#
   5
   6test_description='git update-index on filesystem w/o symlinks test.
   7
   8This 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
  11. ./test-lib.sh
  12
  13test_expect_success \
  14'preparation' '
  15git config core.symlinks false &&
  16l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
  17echo "120000 $l symlink" | git update-index --index-info'
  18
  19test_expect_success \
  20'modify the symbolic link' '
  21echo -n new-file > symlink &&
  22git update-index symlink'
  23
  24test_expect_success \
  25'the index entry must still be a symbolic link' '
  26case "`git ls-files --stage --cached symlink`" in
  27120000" "*symlink) echo ok;;
  28*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
  29esac'
  30
  31test_done