From a0be62c100897573ef1575ec0d5e8b215e9dcafe Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 12 Mar 2012 15:57:13 +0100 Subject: notes-merge: use opendir/readdir instead of using read_directory() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit notes_merge_commit() only needs to list all entries (non-recursively) under a directory, which can be easily accomplished with opendir/readdir and would be more lightweight than read_directory(). read_directory() is designed to list paths inside a working directory. Using it outside of its scope may lead to undesired effects. Apparently, one of the undesired effects of read_directory() is that it doesn't deal with being given absolute paths. This creates problems for notes_merge_commit() when git_path() returns an absolute path, which happens when the current working directory is in a subdirectory of the .git directory. Originally-by: Nguyễn Thái Ngọc Duy Updated-by: Johan Herland Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- t/t3310-notes-merge-manual-resolve.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh index 0c531c3795..d6d6ac608b 100755 --- a/t/t3310-notes-merge-manual-resolve.sh +++ b/t/t3310-notes-merge-manual-resolve.sh @@ -558,7 +558,7 @@ foo bar EOF -test_expect_failure 'switch cwd before committing notes merge' ' +test_expect_success 'switch cwd before committing notes merge' ' git notes add -m foo HEAD && git notes --ref=other add -m bar HEAD && test_must_fail git notes merge refs/notes/other && -- cgit v1.2.3