Files
git/read-cache.c
Junio C Hamano 52b98a7d2f write-index: check and warn when worktree crosses a filesystem boundary
As we are stopping the discovery for the repository directory at
filesystem boundaries by default, you might find yourself in a
situation like this:

 (1) You have a tarball of some sort; you extract it $there;

     $ mkdir $there && cd $there
     $ tar xf /var/tmp/tarball.tar

 (2) You notice that the filesystem lacks enough free space, and
     move some part (say "images/") to a separate filesystem, and
     bind-mount;

     $ mv images $another/. && rm -fr images && mkdir images
     $ mount --bind $another/images images

 (3) You add everything to start the project;

     $ git init && git add .

     Up to this point it would work just fine, as you are at the
     top of the working tree and there is no need for repository
     discovery.

 (4) Go down to a subdirectory and start futzing;

     $ cd images && gimp naughty.jpg && git add -u

     This will break as the repository discovery will not go up
     outside of the "images" directory.

Help users by making "git add" notice at the step (3) above that
the working tree is spread across multiple filesystems and warn.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 16:05:44 -07:00

45 KiB