Skip to content

Commit

Permalink
interpret_branch_name: rename "cp" variable to "at"
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jan 15, 2014
1 parent a39c14a commit f278f40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ static int interpret_upstream_mark(const char *name, int namelen,
*/
int interpret_branch_name(const char *name, int namelen, struct strbuf *buf)
{
char *cp;
char *at;
int len = interpret_nth_prior_checkout(name, buf);

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

cp = strchr(name, '@');
if (!cp)
at = strchr(name, '@');
if (!at)
return -1;

len = interpret_empty_at(name, namelen, cp - name, buf);
len = interpret_empty_at(name, namelen, at - name, buf);
if (len > 0)
return reinterpret(name, namelen, len, buf);

len = interpret_upstream_mark(name, namelen, cp - name, buf);
len = interpret_upstream_mark(name, namelen, at - name, buf);
if (len > 0)
return len;

Expand Down

0 comments on commit f278f40

Please sign in to comment.