branch: externals/ztree
commit 0a5b25f364490a58ef7371534a39c75d11f54132
Merge: c54425a 901c3e3
Author: Alexey Veretennikov <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #68 from webzak/fix_ws_ignore
support -w for different file size
---
ztree-diff-model.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ztree-diff-model.el b/ztree-diff-model.el
index 219ad68..2dc1e4b 100644
--- a/ztree-diff-model.el
+++ b/ztree-diff-model.el
@@ -36,6 +36,9 @@
(defvar ztree-diff-consider-file-permissions nil
"Mark files as different if their permissions are different")
+(defvar ztree-diff-consider-file-size t
+ "Mark files as different if their size different")
+
(defvar ztree-diff-additional-options nil
"Command-line options for the diff program used as a diff backend. These
options are added to default '-q' option.
Should be a list of strings.
@@ -156,8 +159,9 @@ Returns t if equal."
(let* ((file1-untrampified (ztree-untrampify-filename file1))
(file2-untrampified (ztree-untrampify-filename file2)))
(if (or
- (/= (nth 7 (file-attributes file1))
- (nth 7 (file-attributes file2)))
+ (and ztree-diff-consider-file-size
+ (/= (nth 7 (file-attributes file1))
+ (nth 7 (file-attributes file2))))
(and ztree-diff-consider-file-permissions
(not (string-equal (nth 8 (file-attributes file1))
(nth 8 (file-attributes file2)))))