Commit Diff


commit - ccc835f12a86459f480a7ea4b724af67cd0889a7
commit + faf054c3d5fbad3a55534ebe525d58156c7aad27
blob - 18b3158fe6c3a78c184a6b640a87f2f1de46d414
blob + 127b86675c2322fd21f0849b2a7f9df339621c75
--- got/got.c
+++ got/got.c
@@ -452,10 +452,19 @@ edit_logmsg(char **logmsg, const char *editor, const 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");