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>
This commit is contained in:
7
cache.h
7
cache.h
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user