repo: Fix backwards timestamp in ostree_repo_write_commit()
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 3 Dec 2015 17:01:38 +0000 (12:01 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 3 Dec 2015 17:43:52 +0000 (12:43 -0500)
ostree_repo_write_commit_with_time() converts the timestamp to
big-endian byte order.

ostree_repo_write_commit() was also doing this when calling
ostree_repo_write_commit_with_time(), resulting in a corrupted
commit object (timestamp bytes were backwards).

Recent regression in 14ffd7022a8c840f277c81e53864be4ea5fabacb

src/libostree/ostree-repo-commit.c

index bee58caf57da85c28abd2d86c51aa8bed862cd7f..6afc54a1f37559b1ffd9f84f784f78782d4bb39a 100644 (file)
@@ -1978,7 +1978,7 @@ ostree_repo_write_commit (OstreeRepo      *self,
                                           body,
                                           metadata,
                                           root,
-                                          GUINT64_TO_BE (g_date_time_to_unix (now)),
+                                          g_date_time_to_unix (now),
                                           out_commit,
                                           cancellable,
                                           error);