diff options
author | Runxi Yu <me@runxiyu.org> | 2025-06-23 09:24:49 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-06-23 09:24:49 +0800 |
commit | 7b30bf4bbba59924173a2e250802700e899c1bc7 (patch) | |
tree | 93dece04ebfe44a8efd5b27867468d516ff0f0cb /git2d/cmd1.c | |
parent | git2d: x.h include guard should be before its own includes (diff) | |
download | forge-7b30bf4bbba59924173a2e250802700e899c1bc7.tar.gz forge-7b30bf4bbba59924173a2e250802700e899c1bc7.tar.zst forge-7b30bf4bbba59924173a2e250802700e899c1bc7.zip |
git2d: Reformat C code in Linux style
Diffstat (limited to 'git2d/cmd1.c')
-rw-r--r-- | git2d/cmd1.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/git2d/cmd1.c b/git2d/cmd1.c index d30fc04..a7d8b07 100644 --- a/git2d/cmd1.c +++ b/git2d/cmd1.c @@ -5,8 +5,7 @@ #include "x.h" -int -cmd_index(git_repository *repo, struct bare_writer *writer) +int cmd_index(git_repository *repo, struct bare_writer *writer) { /* HEAD tree */ @@ -91,15 +90,18 @@ 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 */ @@ -107,10 +109,12 @@ 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++; |