]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2102-update-index-symlinks.sh
GIT-VERSION-GEN: support non-standard $GIT_DIR path
[thirdparty/git.git] / t / t2102-update-index-symlinks.sh
CommitLineData
78a8d641
JS
1#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
5be60078 6test_description='git update-index on filesystem w/o symlinks test.
78a8d641 7
5be60078 8This tests that git update-index keeps the symbolic link property
78a8d641
JS
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' '
5be60078 15git config core.symlinks false &&
6ecfd91d 16l=$(printf file | git hash-object -t blob -w --stdin) &&
5be60078 17echo "120000 $l symlink" | git update-index --index-info'
78a8d641
JS
18
19test_expect_success \
20'modify the symbolic link' '
6ecfd91d 21printf new-file > symlink &&
5be60078 22git update-index symlink'
78a8d641
JS
23
24test_expect_success \
25'the index entry must still be a symbolic link' '
5be60078 26case "`git ls-files --stage --cached symlink`" in
335f8787 27120000" "*symlink) echo pass;;
5be60078 28*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
78a8d641
JS
29esac'
30
31test_done