blob: 0c6ff567a1d47f52492dd89bd098b25bae737bad [file] [log] [blame]
Junio C Hamano806d13b2008-08-04 00:51:42 -07001#!/bin/sh
2
Junio C Hamano725b0602008-08-04 00:52:37 -07003test_description='update-index and add refuse to add beyond symlinks'
Junio C Hamano806d13b2008-08-04 00:51:42 -07004
5. ./test-lib.sh
6
Johannes Sixt704a3142009-03-04 22:38:24 +01007test_expect_success SYMLINKS setup '
Junio C Hamano806d13b2008-08-04 00:51:42 -07008 >a &&
9 mkdir b &&
10 ln -s b c &&
11 >c/d &&
12 git update-index --add a b/d
13'
14
Johannes Sixt704a3142009-03-04 22:38:24 +010015test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
Junio C Hamano806d13b2008-08-04 00:51:42 -070016 test_must_fail git update-index --add c/d &&
17 ! ( git ls-files | grep c/d )
18'
19
Johannes Sixt704a3142009-03-04 22:38:24 +010020test_expect_success SYMLINKS 'add beyond symlinks' '
Junio C Hamano725b0602008-08-04 00:52:37 -070021 test_must_fail git add c/d &&
22 ! ( git ls-files | grep c/d )
23'
24
Junio C Hamano806d13b2008-08-04 00:51:42 -070025test_done