diff mbox series

[v7,18/20] fixup! submodule--helper run-update-procedure: remove --suboid

Message ID 20220210092833.55360-19-chooglen@google.com (mailing list archive)
State New, archived
Headers show
Series submodule: convert the rest of 'update' to C | expand

Commit Message

Glen Choo Feb. 10, 2022, 9:28 a.m. UTC
Signed-off-by: Glen Choo <chooglen@google.com>
---
 builtin/submodule--helper.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Ævar Arnfjörð Bjarmason Feb. 12, 2022, 2:41 p.m. UTC | #1
On Thu, Feb 10 2022, Glen Choo wrote:

> Signed-off-by: Glen Choo <chooglen@google.com>
> ---
>  builtin/submodule--helper.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index b895e88a64..98d8910930 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -2886,14 +2886,11 @@ static int update_submodule(struct update_data *update_data)
>  					    update_data->sm_path, update_data->update_default,
>  					    &update_data->update_strategy);
>  
> -	/* NEEDSWORK: fix the style issues e.g. braces */
> -	if (update_data->just_cloned) {
> +	if (update_data->just_cloned)
>  		oidcpy(&update_data->suboid, null_oid());
> -	} else {
> -		if (resolve_gitlink_ref(update_data->sm_path, "HEAD", &update_data->suboid))
> -			die(_("Unable to find current revision in submodule path '%s'"),
> -			    update_data->displaypath);
> -	}
> +	else if (resolve_gitlink_ref(update_data->sm_path, "HEAD", &update_data->suboid))
> +		die(_("Unable to find current revision in submodule path '%s'"),
> +			update_data->displaypath);
>  
>  	if (update_data->remote) {
>  		char *remote_name = get_default_remote_submodule(update_data->sm_path);

This fixup looks good, let's apply this fix-up to the relevant preceding
commit.
diff mbox series

Patch

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b895e88a64..98d8910930 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2886,14 +2886,11 @@  static int update_submodule(struct update_data *update_data)
 					    update_data->sm_path, update_data->update_default,
 					    &update_data->update_strategy);
 
-	/* NEEDSWORK: fix the style issues e.g. braces */
-	if (update_data->just_cloned) {
+	if (update_data->just_cloned)
 		oidcpy(&update_data->suboid, null_oid());
-	} else {
-		if (resolve_gitlink_ref(update_data->sm_path, "HEAD", &update_data->suboid))
-			die(_("Unable to find current revision in submodule path '%s'"),
-			    update_data->displaypath);
-	}
+	else if (resolve_gitlink_ref(update_data->sm_path, "HEAD", &update_data->suboid))
+		die(_("Unable to find current revision in submodule path '%s'"),
+			update_data->displaypath);
 
 	if (update_data->remote) {
 		char *remote_name = get_default_remote_submodule(update_data->sm_path);