]> git.ipfire.org Git - thirdparty/git.git/commit - notes-merge.c
notes-merge: use opendir/readdir instead of using read_directory()
authorJohan Herland <johan@herland.net>
Mon, 12 Mar 2012 14:57:13 +0000 (15:57 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Mar 2012 18:13:23 +0000 (11:13 -0700)
commita0be62c100897573ef1575ec0d5e8b215e9dcafe
treede1a9de4859caade3ed7b7d6e3566f9a5423f258
parent01bfec8e52dcfa2da47b54b3c89c3181ae09b9a9
notes-merge: use opendir/readdir instead of using read_directory()

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 <pclouds@gmail.com>
Updated-by: Johan Herland <johan@herland.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes-merge.c
t/t3310-notes-merge-manual-resolve.sh