From 2587d6796605273de3a5ec7ba44ee1c1ac2b9302 Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Fri, 16 Nov 2007 14:25:10 +0100 Subject: Fix t9101 test failure caused by Subversion "auto-props" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a user has an "auto-prop" in his/her ~/.subversion/config file for automatically setting the svn:keyword Id property on all ".c" files (a reasonably common configuration in the Subversion world) then one of the "svn propset" operations in the very first test would become a no-op, which in turn would make the next commit a no-op. This then caused the 25th test ('test propget') to fail because it expects a certain number of commits to have taken place but the actual number of commits was off by one. Björn Steinbrink identified the "auto-prop" feature as the cause of the failure. This patch avoids it by passing the "--no-auto-prop" flag to "svn import" when setting up the test repository, thus ensuring that the "svn propset" operation is no longer a no-op, regardless of the users' settings in their config. Signed-off-by: Wincent Colaiuta Signed-off-by: Junio C Hamano --- t/t9101-git-svn-props.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index 622ea1c0d..02c41697d 100755 --- a/t/t9101-git-svn-props.sh +++ b/t/t9101-git-svn-props.sh @@ -48,7 +48,7 @@ EOF printf "\r\n" > empty_crlf a_empty_crlf=`git-hash-object -w empty_crlf` - svn import -m 'import for git-svn' . "$svnrepo" >/dev/null + svn import --no-auto-props -m 'import for git-svn' . "$svnrepo" >/dev/null cd .. rm -rf import -- cgit v1.2.1 From 0e06cc8b823144be16a9fc1f703126b68d20d3b5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 16 Nov 2007 01:15:41 -0800 Subject: Fix per-directory exclude handing for "git add" In "dir_struct", each exclusion element in the exclusion stack records a base string (pointer to the beginning with length) so that we can tell where it came from, but this pointer is just pointing at the parameter that is given by the caller to the push_exclude_per_directory() function. While read_directory_recursive() runs, calls to excluded() makes use the data in the exclusion elements, including this base string. The caller of read_directory_recursive() is not supposed to free the buffer it gave to push_exclude_per_directory() earlier, until it returns. The test case Bruce Stephens gave in the mailing list discussion was simplified and added to the t3700 test. Signed-off-by: Junio C Hamano --- t/t3700-add.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 't') diff --git a/t/t3700-add.sh b/t/t3700-add.sh index a328bf57e..287e058e3 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -104,9 +104,33 @@ test_expect_success 'add ignored ones with -f' ' git ls-files --error-unmatch d.ig/d.if d.ig/d.ig ' +test_expect_success 'add ignored ones with -f' ' + rm -f .git/index && + git add -f d.?? && + git ls-files --error-unmatch d.ig/d.if d.ig/d.ig +' + +test_expect_success '.gitignore with subdirectory' ' + + rm -f .git/index && + mkdir -p sub/dir && + echo "!dir/a.*" >sub/.gitignore && + >sub/a.ig && + >sub/dir/a.ig && + git add sub/dir && + git ls-files --error-unmatch sub/dir/a.ig && + rm -f .git/index && + ( + cd sub/dir && + git add . + ) && + git ls-files --error-unmatch sub/dir/a.ig +' + mkdir 1 1/2 1/3 touch 1/2/a 1/3/b 1/2/c test_expect_success 'check correct prefix detection' ' + rm -f .git/index && git add 1/2/a 1/3/b 1/2/c ' -- cgit v1.2.1