diff mbox series

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

Message ID 20210308150650.18626-10-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series Move the read_tree() function to its only user | expand

Commit Message

Ævar Arnfjörð Bjarmason March 8, 2021, 3:06 p.m. UTC
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 <avarab@gmail.com>
---
 archive.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

Comments

Elijah Newren March 9, 2021, 5:04 p.m. UTC | #1
On Mon, Mar 8, 2021 at 7:07 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>
> 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 <avarab@gmail.com>
> ---
>  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.

>  {
>         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
>
diff mbox series

Patch

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)
 {
 	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 {