Skip to content

Commit

Permalink
Remove unnecessary found variable from describe.
Browse files Browse the repository at this point in the history
Junio added the found variable to enforce commit date order when two
tags have the same distance from the requested commit.  Except it is
unnecessary as match_cnt is already used to record how many possible
tags have been identified thus far.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Jan 26, 2007
1 parent 007e2ba commit 8a8169c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin-describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ static void describe(const char *arg, int last_one)
struct possible_tag all_matches[MAX_TAGS];
unsigned int match_cnt = 0, annotated_cnt = 0, cur_match;
unsigned long seen_commits = 0;
int found = 0;

if (get_sha1(arg, sha1))
die("Not a valid object name %s", arg);
Expand Down Expand Up @@ -137,7 +136,7 @@ static void describe(const char *arg, int last_one)
t->name = n;
t->depth = seen_commits - 1;
t->flag_within = 1u << match_cnt;
t->found_order = found++;
t->found_order = match_cnt;
c->object.flags |= t->flag_within;
if (n->prio == 2)
annotated_cnt++;
Expand Down

0 comments on commit 8a8169c

Please sign in to comment.