Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 302bd999fd0ef41f3605a2212c23f54ae43649f8 authored by Junio C Hamano on 16 June 2011, 16:21:36 UTC
Git 1.7.6-rc2
Tip revision: 302bd99
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