Re: [RFH] cleaning up "add across symlinks"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 16, 2008 at 1:53 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> If you have this structure in your work tree:
>
>         lrwxrwxrwx a -> c
>         drwxrwxrwx c
>         -rw-rw-rw- c/b
>
>  and let million monkeys give random paths to "git-update-index --add" or
>  "git add", you should end up with the index with two entries, a symlink
>  "a" and file "c/b".
>
>  Not so.  If an unfortunate monkey says "git add a/b", we happily add it to
>  the index, because we notice lstat("a/b") succeeds and assume that there
>  is such a path.  There isn't, as far as git is concerned, because we track
>  symbolic links.

Thanks Junio, I'll try to do some testing with it later.

>  +test_expect_success 'add confusion (3)' '
>  +
>  +       test_must_fail git add "a/*" &&
>  +
>  +       git ls-files >actual &&
>  +       test_cmp expect actual
>  +'
>  +
>  +test_done

That's almost the case I used.  The exact test to add to these,
without the '*' after a/, would be something like this (warning: cut
and paste):

+test_expect_success 'add confusion (4)' '
+
+       test_must_fail git add "a/" &&
+
+       git ls-files >actual &&
+       test_cmp expect actual
+'

Thanks,
Tarmigan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux