# Strange untracked file behaviour

3 messages from 2008-12-16 to 2008-12-17. Participants: Miklos Vajna, Johannes Schindelin.
Thread: https://gitlist.dev/t/16758

## Miklos Vajna, 2008-12-16 23:24

Subject: Strange untracked file behaviour
Message-ID: <20081216232452.GV5691@genesis.frugalware.org>
URL: https://gitlist.dev/e/20081216232452.GV5691%40genesis.frugalware.org

```
Hi,

Here is a copy of the udev repo I cloned some time ago:

http://frugalware.org/~vmiklos/files/udev.tar.bz2

I did not modify it, so I thought a simple 'git pull' can update it.

$ git pull
Updating 661a0be..b6626d0
error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would
be removed by merge.

Ok, let's clean the untracked files:

$ git clean -x -d -f

But it does not remove any file.

$ git ls-files|grep test/sys/class/misc/rtc/dev
test/sys/class/misc/rtc/dev

So it seems git-clean is right.

$ git pull -s resolve
Updating 661a0be..b6626d0
error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would
be removed by merge.

So it does not seem to be merge-recursive-related.

Does somebody have an idea what's going on? :)

$ git version
git version 1.6.1.rc1.35.gae26e.dirty

('dirty' is due to non-code changes in my working directory.)

Let me know if you need more details.

Thanks.

```

## Johannes Schindelin, 2008-12-17 05:09

Subject: Re: Strange untracked file behaviour
Message-ID: <alpine.DEB.1.00.0812170605300.14632@racer>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0812170605300.14632%40racer
In-Reply-To: <20081216232452.GV5691@genesis.frugalware.org>

```
Hi,

On Wed, 17 Dec 2008, Miklos Vajna wrote:

> Here is a copy of the udev repo I cloned some time ago:
> 
> http://frugalware.org/~vmiklos/files/udev.tar.bz2
> 
> I did not modify it, so I thought a simple 'git pull' can update it.
> 
> $ git pull
> Updating 661a0be..b6626d0
> error: Untracked working tree file 'test/sys/class/misc/rtc/dev' would
> be removed by merge.

I just spent three hours narrowing it down to this test case (but now I 
have to catch 3 hours of sleep):

-- snipsnap --
[PATCH] Miklos' testcase

Even if we would not handle symlink/directory conflicts gracefully (which 
we do, though), those conflicts should not affect unchanged files at all, 
especially not claiming that they are untracked.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t1008-read-tree-sd.sh |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 t/t1008-read-tree-sd.sh

diff --git a/t/t1008-read-tree-sd.sh b/t/t1008-read-tree-sd.sh
new file mode 100644
index 0000000..4d74430
--- /dev/null
+++ b/t/t1008-read-tree-sd.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 Johannes E. Schindelin
+#
+
+test_description='symlink/directory conflict'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+
+	mkdir -p alpha/beta/gamma &&
+	ln -s delta alpha/beta/gamma/epsilon &&
+	mkdir -p alpha/beta/theta &&
+	ln -s zeta alpha/beta/theta/eta &&
+	mkdir -p iota/kappa/lambda/ &&
+	: > iota/kappa/lambda/mu &&
+	git add . &&
+	test_tick &&
+	git commit -m initial &&
+
+	git rm -r alpha/beta/gamma &&
+	ln -s nu alpha/beta/gamma &&
+	git rm -r alpha/beta/theta &&
+	ln -s xi alpha/beta/theta &&
+	git add . &&
+	test_tick &&
+	git commit -m 2nd
+
+'
+
+test_expect_failure 'read-tree -u -m handles symlinks gracefully' '
+
+	git checkout -b side HEAD^ &&
+	git read-tree -u -m master
+
+'
+
+test_done
-- 
1.6.0.4.1189.g8876f

```

## Miklos Vajna, 2008-12-17 14:38

Subject: Re: Strange untracked file behaviour
Message-ID: <20081217143825.GC5691@genesis.frugalware.org>
URL: https://gitlist.dev/e/20081217143825.GC5691%40genesis.frugalware.org
In-Reply-To: <alpine.DEB.1.00.0812170605300.14632@racer>

```
On Wed, Dec 17, 2008 at 06:09:16AM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> I just spent three hours narrowing it down to this test case (but now I 
> have to catch 3 hours of sleep):

Thank you very much! :-)

```
