From 625c3304e200f9bdc05626be1397311faa4962ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 5 Sep 2013 10:40:39 +0700 Subject: add: lift the pathspec magic restriction on "add -p" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 480ca64 (convert run_add_interactive to use struct pathspec - 2013-07-14), we have unconditionally passed :(prefix)xxx to add-interactive.perl. It implies that all commands add-interactive.perl calls must be aware of pathspec magic, or :(prefix) is barfed. The restriction to :/ only becomes unnecessary. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/add.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'builtin/add.c') diff --git a/builtin/add.c b/builtin/add.c index 9d52fc791..b4035f646 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -270,13 +270,7 @@ int interactive_add(int argc, const char **argv, const char *prefix, int patch) { struct pathspec pathspec; - /* - * git-add--interactive itself does not parse pathspec. It - * simply passes the pathspec to other builtin commands. Let's - * hope all of them support all magic, or we'll need to limit - * the magic here. - */ - parse_pathspec(&pathspec, PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP, + parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_FULL | PATHSPEC_SYMLINK_LEADING_PATH | PATHSPEC_PREFIX_ORIGIN, -- cgit v1.2.1