diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-13 14:37:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-13 14:37:21 +0100 |
commit | daa8282426c9b8bd28df9d8e471b5b643b826193 (patch) | |
tree | 06e7be25da1792ec871d1af8c3da59e46c5de9d5 /sequencer.c | |
parent | Merge branch 'js/mingw-utf8-env' (diff) | |
parent | sequencer: break out of loop explicitly (diff) | |
download | git-daa8282426c9b8bd28df9d8e471b5b643b826193.tar.xz git-daa8282426c9b8bd28df9d8e471b5b643b826193.zip |
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
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c index 9e1ab3a2a7..405d5ef86b 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2890,7 +2890,7 @@ static int do_reset(const char *name, int len, struct replay_opts *opts) struct tree_desc desc; struct tree *tree; struct unpack_trees_options unpack_tree_opts; - int ret = 0, i; + int ret = 0; if (hold_locked_index(&lock, LOCK_REPORT_ON_ERROR) < 0) return -1; @@ -2910,10 +2910,13 @@ static int do_reset(const char *name, int len, struct replay_opts *opts) } oidcpy(&oid, &opts->squash_onto); } else { + int i; + /* Determine the length of the label */ for (i = 0; i < len; i++) if (isspace(name[i])) - len = i; + break; + len = i; strbuf_addf(&ref_name, "refs/rewritten/%.*s", len, name); if (get_oid(ref_name.buf, &oid) && |