notmuch new: Avoid updating directory timestamp if interrupted.
[notmuch] / notmuch-new.c
index ca68a68473af918dc7004762a8f42f3c85007a67..4adbdc7f60ff4280e7fe2255975afa17bf689a87 100644 (file)
@@ -290,9 +290,11 @@ add_files_recursive (notmuch_database_t *notmuch,
        next = NULL;
     }
 
-    status = notmuch_directory_set_mtime (directory, path_mtime);
-    if (status && ret == NOTMUCH_STATUS_SUCCESS)
-       ret = status;
+    if (! interrupted) {
+       status = notmuch_directory_set_mtime (directory, path_mtime);
+       if (status && ret == NOTMUCH_STATUS_SUCCESS)
+           ret = status;
+    }
 
   DONE:
     if (next)