From 4a38b1115973a8cd00608dc7bc4df96ae93bb79e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 16 Oct 2019 13:38:29 +0000 Subject: [PATCH] commit: [scan-build] Remove a dead assignment The `write_commit()` API defaults to current time, and this assignment became dead in: https://github.com/ostreedev/ostree/commit/8ba90a33410c9707a30a77f808a7ec712d465165 --- src/ostree/ot-builtin-commit.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c index 43eb18b3..0eea09d7 100644 --- a/src/ostree/ot-builtin-commit.c +++ b/src/ostree/ot-builtin-commit.c @@ -772,8 +772,6 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio if (!skip_commit) { - guint64 timestamp; - if (!opt_no_bindings) { g_autoptr(GVariant) old_metadata = g_steal_pointer (&metadata); @@ -782,10 +780,6 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio if (!opt_timestamp) { - GDateTime *now = g_date_time_new_now_utc (); - timestamp = g_date_time_to_unix (now); - g_date_time_unref (now); - if (!ostree_repo_write_commit (repo, parent, opt_subject, commit_body, metadata, OSTREE_REPO_FILE (root), &commit_checksum, cancellable, error)) @@ -800,8 +794,8 @@ ostree_builtin_commit (int argc, char **argv, OstreeCommandInvocation *invocatio "Could not parse '%s'", opt_timestamp); goto out; } - timestamp = ts.tv_sec; + guint64 timestamp = ts.tv_sec; if (!ostree_repo_write_commit_with_time (repo, parent, opt_subject, commit_body, metadata, OSTREE_REPO_FILE (root), timestamp,