commit - 64a300dd8d0fd181638cad5dfdeba7582cb92093
commit + 088f4d22ce3dcd3090bd440308e0b8b4fc8529aa
blob - b37b2e4c4c2c17850b7e2ec9418ca301308a5293
blob + f053979f01ffaadce2c978878c3af4f2ef4eedd4
--- got/got.c
+++ got/got.c
if (spawn_editor(editor, logmsg_path) == -1)
return got_error_from_errno("failed spawning editor");
+ if (require_modification) {
+ struct timespec timeout;
+
+ timeout.tv_sec = 0;
+ timeout.tv_nsec = 1;
+ nanosleep(&timeout, NULL);
+ }
+
if (stat(logmsg_path, &st2) == -1)
return got_error_from_errno("stat");
- if (require_modification && timespeccmp(&st.st_mtim, &st2.st_mtim, ==))
+ if (require_modification && st.st_size == st2.st_size &&
+ timespeccmp(&st.st_mtim, &st2.st_mtim, ==))
return got_error_msg(GOT_ERR_COMMIT_MSG_EMPTY,
"no changes made to commit message, aborting");