Skip to content

Commit f278f40

Browse files
peffgitster
authored andcommitted
interpret_branch_name: rename "cp" variable to "at"
In the original version of this function, "cp" acted as a pointer to many different things. Since the refactoring in the last patch, it only marks the at-sign in the string. Let's use a more descriptive variable name. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a39c14a commit f278f40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sha1_name.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ static int interpret_upstream_mark(const char *name, int namelen,
11191119
*/
11201120
int interpret_branch_name(const char *name, int namelen, struct strbuf *buf)
11211121
{
1122-
char *cp;
1122+
char *at;
11231123
int len = interpret_nth_prior_checkout(name, buf);
11241124

11251125
if (!namelen)
@@ -1134,15 +1134,15 @@ int interpret_branch_name(const char *name, int namelen, struct strbuf *buf)
11341134
return reinterpret(name, namelen, len, buf);
11351135
}
11361136

1137-
cp = strchr(name, '@');
1138-
if (!cp)
1137+
at = strchr(name, '@');
1138+
if (!at)
11391139
return -1;
11401140

1141-
len = interpret_empty_at(name, namelen, cp - name, buf);
1141+
len = interpret_empty_at(name, namelen, at - name, buf);
11421142
if (len > 0)
11431143
return reinterpret(name, namelen, len, buf);
11441144

1145-
len = interpret_upstream_mark(name, namelen, cp - name, buf);
1145+
len = interpret_upstream_mark(name, namelen, at - name, buf);
11461146
if (len > 0)
11471147
return len;
11481148

0 commit comments

Comments
 (0)