author | Junio C Hamano <gitster@pobox.com> | |
Sat, 14 Mar 2009 04:24:08 +0000 (21:24 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 14 Mar 2009 05:51:43 +0000 (22:51 -0700) | ||
commit | 06f33c1735bf76e02f3e2601cde5161e969872a7 | |
tree | 3cff780e24ab8b9b1d63a462148d44216ebdc498 | tree | snapshot |
parent | 924189d6a2d13b18fbfdaa1725569957cf628807 | commit | diff |
Read attributes from the index that is being checked out
Traditionally we used .gitattributes file from the work tree if exists,
and otherwise read from the index as a fallback. When switching to a
branch that has an updated .gitattributes file, and entries in it give
different attributes to other paths being checked out, we should instead
read from the .gitattributes in the index.
This breaks a use case of fixing incorrect entries in the .gitattributes
in the work tree (without adding it to the index) and checking other paths
out, though.
$ edit .gitattributes ;# mark foo.dat as binary
$ rm foo.dat
$ git checkout foo.dat
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Traditionally we used .gitattributes file from the work tree if exists,
and otherwise read from the index as a fallback. When switching to a
branch that has an updated .gitattributes file, and entries in it give
different attributes to other paths being checked out, we should instead
read from the .gitattributes in the index.
This breaks a use case of fixing incorrect entries in the .gitattributes
in the work tree (without adding it to the index) and checking other paths
out, though.
$ edit .gitattributes ;# mark foo.dat as binary
$ rm foo.dat
$ git checkout foo.dat
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c | diff | blob | history | |
attr.h | diff | blob | history | |
unpack-trees.c | diff | blob | history |