Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 0afbf6caa5b16dcfa3074982e5b48e27d452dbbb authored by Junio C Hamano on 15 March 2018, 22:01:05 UTC
Git 2.17-rc0
Tip revision: 0afbf6c
t0055-beyond-symlinks.sh
#!/bin/sh

test_description='update-index and add refuse to add beyond symlinks'

. ./test-lib.sh

test_expect_success SYMLINKS setup '
	>a &&
	mkdir b &&
	ln -s b c &&
	>c/d &&
	git update-index --add a b/d
'

test_expect_success SYMLINKS 'update-index --add beyond symlinks' '
	test_must_fail git update-index --add c/d &&
	! ( git ls-files | grep c/d )
'

test_expect_success SYMLINKS 'add beyond symlinks' '
	test_must_fail git add c/d &&
	! ( git ls-files | grep c/d )
'

test_done
back to top