Skip to content

Commit 2b9cc4e

Browse files
committed
Don't consider an .eml file is changed if size is not changed.
1 parent 22659c1 commit 2b9cc4e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

common/index/index.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,17 @@ void mark_all_ce_unused(struct index_state *index)
463463
index->cache[i]->ce_flags &= ~(CE_UNPACKED | CE_ADDED | CE_NEW_SKIP_WORKTREE);
464464
}
465465

466+
static gboolean
467+
is_eml_file (const char *path)
468+
{
469+
int len = strlen(path);
470+
const char *ext;
471+
472+
if (len < 5)
473+
return FALSE;
474+
ext = &path[len-4];
475+
return (strcasecmp (ext, ".eml") == 0);
476+
}
466477

467478
static int ce_match_stat_basic(struct cache_entry *ce, SeafStat *st)
468479
{
@@ -497,7 +508,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, SeafStat *st)
497508
seaf_warning("internal error: ce_mode is %o\n", ce->ce_mode);
498509
return -1;
499510
}
500-
if (ce->ce_mtime.sec != st->st_mtime)
511+
if (!is_eml_file (ce->name) && ce->ce_mtime.sec != st->st_mtime)
501512
changed |= MTIME_CHANGED;
502513
/* if (ce->ce_ctime.sec != st->st_ctime) */
503514
/* changed |= CTIME_CHANGED; */

0 commit comments

Comments
 (0)