aboutsummaryrefslogtreecommitdiff
path: root/git2d/cmd1.c
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-08-12 11:01:07 +0800
committerRunxi Yu <me@runxiyu.org>2025-09-15 15:19:12 +0800
commiteb82fdb2dc0903e6125014abd64aceab42c8eb35 (patch)
treec07276ba1595c415ebc28943163d88f3e3180254 /git2d/cmd1.c
parentRemove forge-specific functions from misc (diff)
downloadforge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.gz
forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.zst
forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.zip
RefactorHEADmaster
Diffstat (limited to 'git2d/cmd1.c')
-rw-r--r--git2d/cmd1.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/git2d/cmd1.c b/git2d/cmd1.c
index a7d8b07..ec3d1ad 100644
--- a/git2d/cmd1.c
+++ b/git2d/cmd1.c
@@ -90,18 +90,15 @@ int cmd_index(git_repository *repo, struct bare_writer *writer)
/* Title */
size_t msg_len = msg ? strlen(msg) : 0;
- bare_put_data(writer, (const uint8_t *)(msg ? msg : ""),
- msg_len);
+ bare_put_data(writer, (const uint8_t *)(msg ? msg : ""), msg_len);
/* Author's name */
const char *author_name = author ? author->name : "";
- bare_put_data(writer, (const uint8_t *)author_name,
- strlen(author_name));
+ bare_put_data(writer, (const uint8_t *)author_name, strlen(author_name));
/* Author's email */
const char *author_email = author ? author->email : "";
- bare_put_data(writer, (const uint8_t *)author_email,
- strlen(author_email));
+ bare_put_data(writer, (const uint8_t *)author_email, strlen(author_email));
/* Author's date */
/* TODO: Pass the integer instead of a string */
@@ -109,12 +106,10 @@ int cmd_index(git_repository *repo, struct bare_writer *writer)
char timebuf[64];
struct tm *tm = localtime(&time);
if (tm)
- strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S",
- tm);
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm);
else
strcpy(timebuf, "unknown");
- bare_put_data(writer, (const uint8_t *)timebuf,
- strlen(timebuf));
+ bare_put_data(writer, (const uint8_t *)timebuf, strlen(timebuf));
git_commit_free(commit);
count++;