@matheusbsbs / matheus-bagliano / commits / e02f1762b2
Fork 0

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 <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jay Soffian committed Feb 3, 2009 at 12:51 UTC e02f1762b257c50124fc528e8b60bf16e8bb7acf
1 file changed +5 -5
builtin-remote.c
+5 -5
@@ -356,7 +356,7 @@ static int rm(int argc, const char **argv)
356 struct known_remotes known_remotes = { NULL, NULL };
357 struct string_list branches = { NULL, 0, 0, 1 };
358 struct branches_for_remote cb_data = { NULL, &branches, &known_remotes };
359 - int i;
359 + int i, result;
360
361 if (argc != 2)
362 usage_with_options(builtin_remote_usage, options);
@@ -397,14 +397,14 @@ static int rm(int argc, const char **argv)
397 * refs, which are invalidated when deleting a branch.
398 */
399 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);
401 strbuf_release(&buf);
402
403 - if (!i)
404 - i = remove_branches(&branches);
403 + if (!result)
404 + result = remove_branches(&branches);
405 string_list_clear(&branches, 1);
406
407 - return i;
407 + return result;
408 }
409
410 static void show_list(const char *title, struct string_list *list,