blob: 9fa561047430ae40a1860131a024e4fd7744f5cb [file] [log] [blame]
Johannes Sixt78a8d642007-03-02 22:11:30 +01001#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
Junio C Hamano5be60072007-07-02 22:52:14 -07006test_description='git checkout-index on filesystem w/o symlinks test.
Johannes Sixt78a8d642007-03-02 22:11:30 +01007
Junio C Hamano5be60072007-07-02 22:52:14 -07008This tests that git checkout-index creates a symbolic link as a plain
Johannes Sixt78a8d642007-03-02 22:11:30 +01009file if core.symlinks is false.'
10
11. ./test-lib.sh
12
13test_expect_success \
14'preparation' '
Junio C Hamano5be60072007-07-02 22:52:14 -070015git config core.symlinks false &&
Brian Gernhardt6ecfd912008-10-31 01:09:13 -040016l=$(printf file | git hash-object -t blob -w --stdin) &&
Junio C Hamano5be60072007-07-02 22:52:14 -070017echo "120000 $l symlink" | git update-index --index-info'
Johannes Sixt78a8d642007-03-02 22:11:30 +010018
19test_expect_success \
20'the checked-out symlink must be a file' '
Junio C Hamano5be60072007-07-02 22:52:14 -070021git checkout-index symlink &&
Johannes Sixt78a8d642007-03-02 22:11:30 +010022test -f symlink'
23
24test_expect_success \
25'the file must be the blob we added during the setup' '
Nanako Shiraishi0cb0e142008-09-03 17:59:27 +090026test "$(git hash-object -t blob symlink)" = $l'
Johannes Sixt78a8d642007-03-02 22:11:30 +010027
28test_done