Skip to content

Commit e02f176

Browse files
jaysoffiangitster
authored andcommitted
builtin-remote: make rm() use properly named variable to hold return value
"i" is a loop counter and should not be used to hold a return value; use "result" instead which is consistent with the rest of builtin-remote.c. Signed-off-by: Jay Soffian <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bc39564 commit e02f176

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin-remote.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static int rm(int argc, const char **argv)
356356
struct known_remotes known_remotes = { NULL, NULL };
357357
struct string_list branches = { NULL, 0, 0, 1 };
358358
struct branches_for_remote cb_data = { NULL, &branches, &known_remotes };
359-
int i;
359+
int i, result;
360360

361361
if (argc != 2)
362362
usage_with_options(builtin_remote_usage, options);
@@ -397,14 +397,14 @@ static int rm(int argc, const char **argv)
397397
* refs, which are invalidated when deleting a branch.
398398
*/
399399
cb_data.remote = remote;
400-
i = for_each_ref(add_branch_for_removal, &cb_data);
400+
result = for_each_ref(add_branch_for_removal, &cb_data);
401401
strbuf_release(&buf);
402402

403-
if (!i)
404-
i = remove_branches(&branches);
403+
if (!result)
404+
result = remove_branches(&branches);
405405
string_list_clear(&branches, 1);
406406

407-
return i;
407+
return result;
408408
}
409409

410410
static void show_list(const char *title, struct string_list *list,

0 commit comments

Comments
 (0)