summaryrefslogtreecommitdiff
path: root/attr.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-13 21:24:08 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-13 22:51:43 -0700
commit06f33c1735bf76e02f3e2601cde5161e969872a7 (patch)
tree3cff780e24ab8b9b1d63a462148d44216ebdc498 /attr.h
parent924189d6a2d13b18fbfdaa1725569957cf628807 (diff)
downloadgit-06f33c1735bf76e02f3e2601cde5161e969872a7.tar.gz
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>
Diffstat (limited to 'attr.h')
-rw-r--r--attr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/attr.h b/attr.h
index f1c2038b09..3a2f4ec1a0 100644
--- a/attr.h
+++ b/attr.h
@@ -31,4 +31,10 @@ struct git_attr_check {
int git_checkattr(const char *path, int, struct git_attr_check *);
+enum git_attr_direction {
+ GIT_ATTR_CHECKIN,
+ GIT_ATTR_CHECKOUT
+};
+void git_attr_set_direction(enum git_attr_direction, struct index_state *);
+
#endif /* ATTR_H */