Revision 16fe1e03694e75a3923c3a757ec946aa6098aec7 authored by Frank Li on 16 September 2009, 08:20:24 UTC, committed by Junio C Hamano on 19 September 2009, 03:00:42 UTC
Added the header files dirent.h, unistd.h and utime.h
Add alloca.h, which simply includes malloc.h, which defines alloca().

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 55fcb06
Raw File
t5501-post-upload-pack.sh
#!/bin/sh

test_description='post upload-hook'

. ./test-lib.sh

LOGFILE=".git/post-upload-pack-log"

test_expect_success setup '
	test_commit A &&
	test_commit B &&
	git reset --hard A &&
	test_commit C &&
	git branch prev B &&
	mkdir -p .git/hooks &&
	{
		echo "#!$SHELL_PATH" &&
		echo "cat >post-upload-pack-log"
	} >".git/hooks/post-upload-pack" &&
	chmod +x .git/hooks/post-upload-pack
'

test_expect_success initial '
	rm -fr sub &&
	git init sub &&
	(
		cd sub &&
		git fetch --no-tags .. prev
	) &&
	want=$(sed -n "s/^want //p" "$LOGFILE") &&
	test "$want" = "$(git rev-parse --verify B)" &&
	! grep "^have " "$LOGFILE" &&
	kind=$(sed -n "s/^kind //p" "$LOGFILE") &&
	test "$kind" = fetch
'

test_expect_success second '
	rm -fr sub &&
	git init sub &&
	(
		cd sub &&
		git fetch --no-tags .. prev:refs/remotes/prev &&
		git fetch --no-tags .. master
	) &&
	want=$(sed -n "s/^want //p" "$LOGFILE") &&
	test "$want" = "$(git rev-parse --verify C)" &&
	have=$(sed -n "s/^have //p" "$LOGFILE") &&
	test "$have" = "$(git rev-parse --verify B)" &&
	kind=$(sed -n "s/^kind //p" "$LOGFILE") &&
	test "$kind" = fetch
'

test_expect_success all '
	rm -fr sub &&
	HERE=$(pwd) &&
	git init sub &&
	(
		cd sub &&
		git clone "file://$HERE/.git" new
	) &&
	sed -n "s/^want //p" "$LOGFILE" | sort >actual &&
	git rev-parse A B C | sort >expect &&
	test_cmp expect actual &&
	! grep "^have " "$LOGFILE" &&
	kind=$(sed -n "s/^kind //p" "$LOGFILE") &&
	test "$kind" = clone
'

test_done
back to top