mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 15:33:51 +00:00
Merge pull request #1074 from edubart/ignore_diff_filemode
Add option to ignore file mode in diffs
This commit is contained in:
commit
4a0c7f56ab
@ -86,6 +86,8 @@ typedef enum {
|
|||||||
* mode set to tree. Note: the tree SHA will not be available.
|
* mode set to tree. Note: the tree SHA will not be available.
|
||||||
*/
|
*/
|
||||||
GIT_DIFF_INCLUDE_TYPECHANGE_TREES = (1 << 16),
|
GIT_DIFF_INCLUDE_TYPECHANGE_TREES = (1 << 16),
|
||||||
|
/** Ignore file mode changes */
|
||||||
|
GIT_DIFF_IGNORE_FILEMODE = (1 << 17),
|
||||||
} git_diff_option_t;
|
} git_diff_option_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -267,6 +267,9 @@ static git_diff_list *git_diff_list_alloc(
|
|||||||
|
|
||||||
memcpy(&diff->opts, opts, sizeof(git_diff_options));
|
memcpy(&diff->opts, opts, sizeof(git_diff_options));
|
||||||
|
|
||||||
|
if(opts->flags & GIT_DIFF_IGNORE_FILEMODE)
|
||||||
|
diff->diffcaps = diff->diffcaps & ~GIT_DIFFCAPS_TRUST_MODE_BITS;
|
||||||
|
|
||||||
/* pathspec init will do nothing for empty pathspec */
|
/* pathspec init will do nothing for empty pathspec */
|
||||||
if (git_pathspec_init(&diff->pathspec, &opts->pathspec, &diff->pool) < 0)
|
if (git_pathspec_init(&diff->pathspec, &opts->pathspec, &diff->pool) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user