diff options
author | Calvin Wan <calvinwan@google.com> | 2022-11-08 18:41:57 +0000 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-11-08 15:29:31 -0500 |
commit | 08a4fa092735cb43b200abc1e90fa3a8286381e0 (patch) | |
tree | 646a43cc26573a9abcc3fcbd3ae338bb1d08eb2d | |
parent | 08f8f87541ddb70f02baba2057589716bde09753 (diff) | |
download | git-08a4fa092735cb43b200abc1e90fa3a8286381e0.tar.gz |
submodule: strbuf variable rename
A prepatory change for a future patch that moves the status parsing
logic to a separate function.
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
-rw-r--r-- | submodule.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/submodule.c b/submodule.c index f7c71f1f4b..ac214f250d 100644 --- a/submodule.c +++ b/submodule.c @@ -1900,25 +1900,28 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) fp = xfdopen(cp.out, "r"); while (strbuf_getwholeline(&buf, fp, '\n') != EOF) { + char *str = buf.buf; + const size_t len = buf.len; + /* regular untracked files */ - if (buf.buf[0] == '?') + if (str[0] == '?') dirty_submodule |= DIRTY_SUBMODULE_UNTRACKED; - if (buf.buf[0] == 'u' || - buf.buf[0] == '1' || - buf.buf[0] == '2') { + if (str[0] == 'u' || + str[0] == '1' || + str[0] == '2') { /* T = line type, XY = status, SSSS = submodule state */ - if (buf.len < strlen("T XY SSSS")) + if (len < strlen("T XY SSSS")) BUG("invalid status --porcelain=2 line %s", - buf.buf); + str); - if (buf.buf[5] == 'S' && buf.buf[8] == 'U') + if (str[5] == 'S' && str[8] == 'U') /* nested untracked file */ dirty_submodule |= DIRTY_SUBMODULE_UNTRACKED; - if (buf.buf[0] == 'u' || - buf.buf[0] == '2' || - memcmp(buf.buf + 5, "S..U", 4)) + if (str[0] == 'u' || + str[0] == '2' || + memcmp(str + 5, "S..U", 4)) /* other change */ dirty_submodule |= DIRTY_SUBMODULE_MODIFIED; } |