Move pathspec matching from builtin-add.c into dir.c