From: Junio C Hamano Date: Thu, 09 Aug 2018 22:00:08 GMT Subject: Re: [PATCH 04/10] submodule.c: convert submodule_move_head new argument to object id Message-ID: In-Reply-To: <20180808221752.195419-5-sbeller@google.com> Stefan Beller writes: > All callers use oid_to_hex to convert the desired oid to a string before > calling submodule_move_head. Defer the conversion to the > submodule_move_head as it will turn out to be useful in a bit. > > Signed-off-by: Stefan Beller > --- > entry.c | 6 +++--- > submodule.c | 12 ++++++------ > submodule.h | 2 +- > unpack-trees.c | 13 +++++-------- > 4 files changed, 15 insertions(+), 18 deletions(-) > > diff --git a/entry.c b/entry.c > index b5d1d3cf231..4b34dfd30df 100644 > --- a/entry.c > +++ b/entry.c > @@ -358,7 +358,7 @@ static int write_entry(struct cache_entry *ce, > sub = submodule_from_ce(ce); > if (sub) > return submodule_move_head(ce->name, > - NULL, oid_to_hex(&ce->oid), > + NULL, &ce->oid, > state->force ? SUBMODULE_MOVE_HEAD_FORCE : 0); > break; Nice.