]> git.ipfire.org Git - thirdparty/git.git/commit - dir.c
dir: simplify untracked cache "ident" field
authorChristian Couder <christian.couder@gmail.com>
Sun, 24 Jan 2016 15:28:21 +0000 (16:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jan 2016 20:40:17 +0000 (12:40 -0800)
commit0e0f761842eafb51c1a5d93fbc84470e2d7ee7c3
tree75a11592ec94f7fe242f7723376fd427f1502381
parent07b29bfd8d3de9a16c1c93e285b6980ca6b77b45
dir: simplify untracked cache "ident" field

It is not a good idea to compare kernel versions and disable
the untracked cache if it changes, as people may upgrade and
still want the untracked cache to work. So let's just
compare work tree locations and kernel name to decide if we
should disable it.

Also storing many locations in the ident field and comparing
to any of them can be dangerous if GIT_WORK_TREE is used with
different values. So let's just store one location, the
location of the current work tree.

The downside is that untracked cache can only be used by one
type of OS for now. Exporting a git repo to different clients
via a network to e.g. Linux and Windows means that only one
can use the untracked cache.

If the location changed in the ident field and we still want
an untracked cache, let's delete the cache and recreate it.

Note that if an untracked cache has been created by a
previous Git version, then the kernel version is stored in
the ident field. As we now compare with just the kernel
name the comparison will fail and the untracked cache will
be disabled until it's recreated.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
dir.h