Re: [PATCH] add: don't complain when adding empty project root
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 23, 2013, 23:46 UTC
- Message-ID
- <CACsJy8A7j_ERqH_TDuKDdssaLFCvM5yVT4eUjTqkN_qW4iXuGA@mail.gmail.com>
- In-Reply-To
- <52B87759.2090901@web.de>
On Tue, Dec 24, 2013 at 12:48 AM, Torsten Bögershausen <tboegi@web.de> wrote:
Show 30 quoted lines
>> +test_expect_success 'git add -A on empty repo does not error out' ' >> + git init empty && ( cd empty && git add -A . ) >> +' >> + >> test_done >> > I am (a little bit) confused. > > This is what git does: > rm -rf test && mkdir test && cd test && git init && touch A && mkdir D && cd D && touch B && git add . && git status > Initialized empty Git repository in /Users/tb/test/test/.git/ > On branch master > > Initial commit > > Changes to be committed: > (use "git rm --cached <file>..." to unstage) > > new file: B > > Untracked files: > (use "git add <file>..." to include in what will be committed) > > ../A > ---------------- > And the behaviour is in line with > https://www.kernel.org/pub/software/scm/git/docs/git-add.html > > "." stands for the current directory somewhere in the worktree, > not only the "project root".
Yes, except in this case "." is project root because current dir is. I could have done "git add -A" (without the dot) like reported, but that will be deprecated soon. Another way to make it clear about project root is use "git add -A :/". I'll send an update if it makes it clearer.
Show 6 quoted lines
> ----------------- > > Could it make sense to mention that replace > [PATCH] add: don't complain when adding empty project root > with > [PATCH] add: don't complain when adding empty directory.
We don't complain about adding an empty directory before or after this patch.
> > (and similar in the commit message) > /Torsten >
-- Duy