git diff and file deleted from the cache

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

 



The manual of git-diff tell me that :
  git-diff [--options] <commit> [--] [<path>...]
      This form is to view the changes you have in your working tree
      relative to the named <commit>. You can use HEAD to compare it with
      the latest commit, or a branch name to compare with the tip of a
      different branch.

So the following seem strange :

$ echo foo > bar
$ git commit -m "committing bar" -a
Created commit 074893b: committing bar
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 bar
$ git rm --cached bar
rm 'bar'
$ git diff HEAD --
diff --git a/bar b/bar
deleted file mode 100644
index 257cc56..0000000
--- a/bar
+++ /dev/null
@@ -1 +0,0 @@
-foo

I excepted the diff to be empty, as HEAD and the working directory are
synchronized, I've only modified the cache.

-- 
Rémi Vanicat
-
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