Thread (193 messages) flat view 193 messages, 3 authors, 2021-03-21

Re: [PATCH 09/30] tree.h users: format argument lists in archive.c

From: Elijah Newren <hidden>
Date: 2021-03-09 17:04:59

On Mon, Mar 8, 2021 at 7:07 AM Ævar Arnfjörð Bjarmason [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Re-indent and re-flow the argument lists archive.c has downstream of
its read_tree_recursive() call to make subsequent commits easier to
read, as I only expect to be modifying the "stage" and "mode" lines.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 archive.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/archive.c b/archive.c
index db69a8acadb..e245c0d5a54 100644
--- a/archive.c
+++ b/archive.c
@@ -140,7 +140,8 @@ static int check_attr_export_subst(const struct attr_check *check)
 static int write_archive_entry(const struct object_id *oid, const char *base,
                               int baselen, const char *filename,
                               unsigned mode,
-                              int stage, void *context)
+                              int stage,
+                              void *context)
You just barely changed this function signature in the previous patch
to split long lines, but left stage & context on the same line.  It
seems like this change should be squashed into the previous patch.
quoted hunk ↗ jump to hunk
 {
        static struct strbuf path = STRBUF_INIT;
        struct archiver_context *c = context;
@@ -197,8 +198,10 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
 }

 static void queue_directory(const unsigned char *sha1,
-               struct strbuf *base, const char *filename,
-               unsigned mode, int stage, struct archiver_context *c)
+                           struct strbuf *base, const char *filename,
+                           unsigned mode,
+                           int stage,
+                           struct archiver_context *c)
 {
        struct directory *d;
        size_t len = st_add4(base->len, 1, strlen(filename), 1);
@@ -224,8 +227,10 @@ static int write_directory(struct archiver_context *c)
        ret =
                write_directory(c) ||
                write_archive_entry(&d->oid, d->path, d->baselen,
-                                   d->path + d->baselen, d->mode,
-                                   d->stage, c) != READ_TREE_RECURSIVE;
+                                   d->path + d->baselen,
+                                   d->mode,
+                                   d->stage,
+                                   c) != READ_TREE_RECURSIVE;
        free(d);
        return ret ? -1 : 0;
 }
@@ -259,14 +264,18 @@ static int queue_or_write_archive_entry(const struct object_id *oid,
                if (check_attr_export_ignore(check))
                        return 0;
                queue_directory(oid->hash, base, filename,
-                               mode, stage, c);
+                               mode,
+                               stage,
+                               c);
                return READ_TREE_RECURSIVE;
        }

        if (write_directory(c))
                return -1;
-       return write_archive_entry(oid, base->buf, base->len, filename, mode,
-                                  stage, context);
+       return write_archive_entry(oid, base->buf, base->len, filename,
+                                  mode,
+                                  stage,
+                                  context);
 }

 struct extra_file_info {
--
2.31.0.rc0.126.g04f22c5b82
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help