diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-02-05 17:52:21 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-07 15:05:25 -0800 |
commit | c879daa23729547fb28aa7e8783c5e4e619a9e7c (patch) | |
tree | 0c73b7150204bf11f9ca90683b36e3229fb22279 /cache.h | |
parent | cf7b1cad0e8b024538de975dff5893262cec72d7 (diff) | |
download | git-c879daa23729547fb28aa7e8783c5e4e619a9e7c.tar.gz git-c879daa23729547fb28aa7e8783c5e4e619a9e7c.tar.xz |
Make hash-object more robust against malformed objects
Commits, trees and tags have structure. Don't let users feed git
with malformed ones. Sooner or later git will die() when
encountering them.
Note that this patch does not check semantics. A tree that points
to non-existent objects is perfectly OK (and should be so, users
may choose to add commit first, then its associated tree for example).
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 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -501,7 +501,7 @@ extern int ie_match_stat(const struct index_state *, struct cache_entry *, struc extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int); extern int ce_path_match(const struct cache_entry *ce, const char **pathspec); -extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path); +extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path, int format_check); extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object); extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st); |