diff mbox series

[v5,13/18] tree-walk.h API: formatting changes for subsequent commit

Message ID patch-13.19-9c96d472472-20210331T190531Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series tree-walk.h: slimmed down | expand

Commit Message

Ævar Arnfjörð Bjarmason March 31, 2021, 7:09 p.m. UTC
Do formatting (mainly whitespace) changes of code around the
get_tree_entry() function to make a subsequent change where we'll add
a sister function easier to read.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 tree-walk.c |  9 ++++++---
 tree-walk.h | 12 ++++++++----
 2 files changed, 14 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/tree-walk.c b/tree-walk.c
index 2d6226d5f18..fc2ce547c4e 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -589,7 +589,8 @@  static int find_tree_entry(struct repository *r, struct tree_desc *t,
 			oidcpy(result, &oid);
 			return 0;
 		}
-		return get_tree_entry(r, &oid, name + entrylen, result, mode);
+		return get_tree_entry(r, &oid, name + entrylen, result,
+				      mode);
 	}
 	return -1;
 }
@@ -620,7 +621,8 @@  int get_tree_entry(struct repository *r,
 	} else {
 		struct tree_desc t;
 		init_tree_desc(&t, tree, size);
-		retval = find_tree_entry(r, &t, name, oid, mode);
+		retval = find_tree_entry(r, &t, name, oid,
+					 mode);
 	}
 	free(tree);
 	return retval;
@@ -746,7 +748,8 @@  enum get_oid_result get_tree_entry_follow_symlinks(struct repository *r,
 
 		/* Look up the first (or only) path component in the tree. */
 		find_result = find_tree_entry(r, &t, namebuf.buf,
-					      &current_tree_oid, mode);
+					      &current_tree_oid,
+					      mode);
 		if (find_result) {
 			goto done;
 		}
diff --git a/tree-walk.h b/tree-walk.h
index a5058469e9b..09e40d9221d 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -167,10 +167,14 @@  struct traverse_info {
 
 /**
  * Find an entry in a tree given a pathname and the sha1 of a tree to
- * search. Returns 0 if the entry is found and -1 otherwise. The third
- * and fourth parameters are set to the entry's sha1 and mode respectively.
- */
-int get_tree_entry(struct repository *, const struct object_id *, const char *, struct object_id *, unsigned short *);
+ * search. Returns 0 if the entry is found and -1 otherwise.
+ *
+ * The third and fourth parameters are set to the entry's sha1 and
+ * mode respectively.
+ */
+int get_tree_entry(struct repository *, const struct object_id *, const char *,
+		   struct object_id *,
+		   unsigned short *);
 
 /**
  * Generate the full pathname of a tree entry based from the root of the