for-each-ref: rename variables called sort to sorting

Rename all the variables called sort to sorting to match the function/structure name changes made in the previous patch. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Karthik Nayak committed Jun 14, 2015 at 01:07 UTC 73079d21ec5c5e510e0f120603b9efd748d63798
1 file changed +14 -14
builtin/for-each-ref.c
+14 -14
@@ -985,9 +985,9 @@ static int compare_refs(const void *a_, const void *b_)
985 return 0;
986 }
987
988 -void ref_array_sort(struct ref_sorting *sort, struct ref_array *array)
988 +void ref_array_sort(struct ref_sorting *sorting, struct ref_array *array)
989 {
990 - ref_sorting = sort;
990 + ref_sorting = sorting;
991 qsort(array->items, array->nr, sizeof(struct ref_array_item *), compare_refs);
992 }
993
@@ -1089,16 +1089,16 @@ struct ref_sorting *ref_default_sorting(void)
1089 {
1090 static const char cstr_name[] = "refname";
1091
1092 - struct ref_sorting *sort = xcalloc(1, sizeof(*sort));
1092 + struct ref_sorting *sorting = xcalloc(1, sizeof(*sorting));
1093
1094 - sort->next = NULL;
1095 - sort->atom = parse_ref_filter_atom(cstr_name, cstr_name + strlen(cstr_name));
1096 - return sort;
1094 + sorting->next = NULL;
1095 + sorting->atom = parse_ref_filter_atom(cstr_name, cstr_name + strlen(cstr_name));
1096 + return sorting;
1097 }
1098
1099 int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset)
1100 {
1101 - struct ref_sorting **sort_tail = opt->value;
1101 + struct ref_sorting **sorting_tail = opt->value;
1102 struct ref_sorting *s;
1103 int len;
1104
@@ -1106,8 +1106,8 @@ int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset)
1106 return -1;
1107
1108 s = xcalloc(1, sizeof(*s));
1109 - s->next = *sort_tail;
1110 - *sort_tail = s;
1109 + s->next = *sorting_tail;
1110 + *sorting_tail = s;
1111
1112 if (*arg == '-') {
1113 s->reverse = 1;
@@ -1127,7 +1127,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
1127 {
1128 int i;
1129 const char *format = "%(objectname) %(objecttype)\t%(refname)";
1130 - struct ref_sorting *sort = NULL, **sort_tail = &sort;
1130 + struct ref_sorting *sorting = NULL, **sorting_tail = &sorting;
1131 int maxcount = 0, quote_style = 0;
1132 struct ref_filter_cbdata ref_cbdata;
1133
@@ -1144,7 +1144,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
1144 OPT_GROUP(""),
1145 OPT_INTEGER( 0 , "count", &maxcount, N_("show only <n> matched refs")),
1146 OPT_STRING( 0 , "format", &format, N_("format"), N_("format to use for the output")),
1147 - OPT_CALLBACK(0 , "sort", sort_tail, N_("key"),
1147 + OPT_CALLBACK(0 , "sort", sorting_tail, N_("key"),
1148 N_("field name to sort on"), &parse_opt_ref_sorting),
1149 OPT_END(),
1150 };
@@ -1161,8 +1161,8 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
1161 if (verify_ref_format(format))
1162 usage_with_options(for_each_ref_usage, opts);
1163
1164 - if (!sort)
1165 - sort = ref_default_sorting();
1164 + if (!sorting)
1165 + sorting = ref_default_sorting();
1166
1167 /* for warn_ambiguous_refs */
1168 git_config(git_default_config, NULL);
@@ -1171,7 +1171,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
1171 ref_cbdata.filter.name_patterns = argv;
1172 for_each_rawref(ref_filter_handler, &ref_cbdata);
1173
1174 - ref_array_sort(sort, &ref_cbdata.array);
1174 + ref_array_sort(sorting, &ref_cbdata.array);
1175
1176 if (!maxcount || ref_cbdata.array.nr < maxcount)
1177 maxcount = ref_cbdata.array.nr;