diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-02-03 13:23:34 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-07 15:04:30 -0800 |
commit | a2b7a3b3a966c5801efe968d4b5656fa5a885409 (patch) | |
tree | 10fa9f1407f71ccec95459533dddf9c956f3559d /ctype.c | |
parent | gitweb: Mention optional Perl modules in INSTALL (diff) | |
download | tgif-a2b7a3b3a966c5801efe968d4b5656fa5a885409.tar.xz |
diff: support --cached on unborn branches
"git diff --cached" (without revision) used to mean "git diff --cached
HEAD" (i.e. the user was too lazy to type HEAD). This "correctly"
failed when there was no commit yet. But was that correctness useful?
This patch changes the definition of what particular command means.
It is a request to show what _would_ be committed without further "git
add". The internal implementation is the same "git diff --cached HEAD"
when HEAD exists, but when there is no commit yet, it compares the index
with an empty tree object to achieve the desired result.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ctype.c')
0 files changed, 0 insertions, 0 deletions