diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-11-30 22:22:38 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-02 02:24:46 -0800 |
commit | b45563a229f5150271837cf487a91ddd8224fbd3 (patch) | |
tree | a0b363c225777490a4c22adaf280ea7ef69f7772 /cache.h | |
parent | 1c46ab1fada6eb449336a624995293cdd74f2b08 (diff) | |
download | git-b45563a229f5150271837cf487a91ddd8224fbd3.tar.gz |
rename: Break filepairs with different types.
When we consider if a path has been totally rewritten, we did not
touch changes from symlinks to files or vice versa. But a change
that modifies even the type of a blob surely should count as a
complete rewrite.
While we are at it, modernise diffcore-break to be aware of gitlinks (we
do not want to touch them).
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -192,6 +192,13 @@ enum object_type { OBJ_MAX, }; +static inline enum object_type object_type(unsigned int mode) +{ + return S_ISDIR(mode) ? OBJ_TREE : + S_ISGITLINK(mode) ? OBJ_COMMIT : + OBJ_BLOB; +} + #define GIT_DIR_ENVIRONMENT "GIT_DIR" #define GIT_WORK_TREE_ENVIRONMENT "GIT_WORK_TREE" #define DEFAULT_GIT_DIR_ENVIRONMENT ".git" |