Hi,
when I stage a file deletion (named foo) and than add a new file
(named foo/bar) in a directory with the name of deleted file. git
diff --cached -- foo shows me the diff for both the file foo and file
foo/bar.
Here is a recipe:
echo foo >f
git add f
git commit -mfoo
git rm f
mkdir f
echo bar >f/0
git add f/0
git diff -- f
git diff --cached -- f
gives me this:
diff --git c/f i/f
deleted file mode 100644
index 257cc56..0000000
--- c/f
+++ /dev/null
diff --git c/f/0 i/f/0
new file mode 100644
index 0000000..5716ca5
--- /dev/null
+++ i/f/0
For the other case, when I stage a symlink under the name foo, I can
understand that git diff shows me two diffs. But for the case
file->directory, I would like to see only the deleted diff, not
recursing into the directory.
Bert