Skip to content

Commit 60b7f38

Browse files
MadCoderJunio C Hamano
authored andcommitted
avoid to use error that shadows the function name, use err instead.
builtin-apply.c and builtin-push.c uses a local variable called 'error' which shadows the error() function. Signed-off-by: Pierre Habouzit <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b05faa2 commit 60b7f38

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

builtin-apply.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,13 +1907,13 @@ static int check_patch(struct patch *patch, struct patch *prev_patch)
19071907
static int check_patch_list(struct patch *patch)
19081908
{
19091909
struct patch *prev_patch = NULL;
1910-
int error = 0;
1910+
int err = 0;
19111911

19121912
for (prev_patch = NULL; patch ; patch = patch->next) {
1913-
error |= check_patch(patch, prev_patch);
1913+
err |= check_patch(patch, prev_patch);
19141914
prev_patch = patch;
19151915
}
1916-
return error;
1916+
return err;
19171917
}
19181918

19191919
static void show_index_list(struct patch *list)

builtin-push.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static int do_push(const char *repo)
232232
common_argc = argc;
233233

234234
for (i = 0; i < n; i++) {
235-
int error;
235+
int err;
236236
int dest_argc = common_argc;
237237
int dest_refspec_nr = refspec_nr;
238238
const char **dest_refspec = refspec;
@@ -248,10 +248,10 @@ static int do_push(const char *repo)
248248
while (dest_refspec_nr--)
249249
argv[dest_argc++] = *dest_refspec++;
250250
argv[dest_argc] = NULL;
251-
error = run_command_v(argc, argv);
252-
if (!error)
251+
err = run_command_v(argc, argv);
252+
if (!err)
253253
continue;
254-
switch (error) {
254+
switch (err) {
255255
case -ERR_RUN_COMMAND_FORK:
256256
die("unable to fork for %s", sender);
257257
case -ERR_RUN_COMMAND_EXEC:
@@ -262,7 +262,7 @@ static int do_push(const char *repo)
262262
case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
263263
die("%s died with strange error", sender);
264264
default:
265-
return -error;
265+
return -err;
266266
}
267267
}
268268
return 0;

0 commit comments

Comments
 (0)