From 900647104e02e545064789f3c6b90a5807fba07b Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Wed, 29 Sep 2010 15:35:24 +0400 Subject: blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664'' We need to get the correct mode when blame reads the source from the working tree, the index, or trees. This allows us to omit running textconv filters on symbolic links. Signed-off-by: Kirill Smelkov Reviewed-by: Matthieu Moy Signed-off-by: Junio C Hamano --- sha1_name.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sha1_name.c') diff --git a/sha1_name.c b/sha1_name.c index 4af94fa59..36c9cbf1a 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -1068,6 +1068,7 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1, struct cache_entry *ce; int pos; if (namelen > 2 && name[1] == '/') + /* don't need mode for commit */ return get_sha1_oneline(name + 2, sha1); if (namelen < 3 || name[2] != ':' || @@ -1095,6 +1096,7 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1, break; if (ce_stage(ce) == stage) { hashcpy(sha1, ce->sha1); + oc->mode = ce->ce_mode; return 0; } pos++; -- cgit v1.2.1