diff options
author | Kirill Smelkov <kirr@landau.phys.spbu.ru> | 2010-09-29 11:35:24 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-29 23:53:25 (GMT) |
commit | 900647104e02e545064789f3c6b90a5807fba07b (patch) | |
tree | 18afcf6ef450617cf0944058d40fe9e14c93312a /sha1_name.c | |
parent | ab3b7b9a6e3bf5793520f06eb76fb03ffe8231cb (diff) | |
download | git-900647104e02e545064789f3c6b90a5807fba07b.zip git-900647104e02e545064789f3c6b90a5807fba07b.tar.gz git-900647104e02e545064789f3c6b90a5807fba07b.tar.bz2 |
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 <kirr@landau.phys.spbu.ru>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r-- | sha1_name.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sha1_name.c b/sha1_name.c index 4af94fa..36c9cbf 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++; |