Skip to content

Commit daa8282

Browse files
committed
Merge branch 'ma/sequencer-do-reset-saner-loop-termination'
Code readability fix. * ma/sequencer-do-reset-saner-loop-termination: sequencer: break out of loop explicitly
2 parents 0474cd1 + 71571cd commit daa8282

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sequencer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,7 +2890,7 @@ static int do_reset(const char *name, int len, struct replay_opts *opts)
28902890
struct tree_desc desc;
28912891
struct tree *tree;
28922892
struct unpack_trees_options unpack_tree_opts;
2893-
int ret = 0, i;
2893+
int ret = 0;
28942894

28952895
if (hold_locked_index(&lock, LOCK_REPORT_ON_ERROR) < 0)
28962896
return -1;
@@ -2910,10 +2910,13 @@ static int do_reset(const char *name, int len, struct replay_opts *opts)
29102910
}
29112911
oidcpy(&oid, &opts->squash_onto);
29122912
} else {
2913+
int i;
2914+
29132915
/* Determine the length of the label */
29142916
for (i = 0; i < len; i++)
29152917
if (isspace(name[i]))
2916-
len = i;
2918+
break;
2919+
len = i;
29172920

29182921
strbuf_addf(&ref_name, "refs/rewritten/%.*s", len, name);
29192922
if (get_oid(ref_name.buf, &oid) &&

0 commit comments

Comments
 (0)