From: Duy Nguyen Date: Mon, 20 Apr 2015 01:34:33 GMT Subject: Re: [PATCH] pathspec: adjust prefixlen after striping trailing slash Message-ID: In-Reply-To: <5533A567.7070301@web.de> On Sun, Apr 19, 2015 at 7:53 PM, Jens Lehmann wrote: > And me thinks it should error out. We already do that when trying > to add a specific file from above the gitlink: > > $ git add subrepo/a > fatal: Pathspec 'subrepo/a' is in submodule 'subrepo' > > And from below the gitlink: > > $ cd subrepo > $ git add a > fatal: Pathspec 'a' is in submodule 'subrepo' > > I think we should do the same when using "git add ." below the > gitlink. But if you look at it another way, "cd subrepo; git add ." should be the same as "git add subrepo" and the latter does not error out (I think because it hits the "if (!is_directory())" in is_submodule_modified()). If we make the former error out, I suspect the latter will follow the same behavior. Just double checking if this is what we want.. -- Duy