Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-10-24 12:53:01 +0400
committerJunio C Hamano <gitster@pobox.com>2013-10-25 02:43:50 +0400
commit0064053bd76ba385e1b5d51b6175bc17bc507804 (patch)
tree50da5cf8b850762e6219618292a14941fd163e2f
parent7059dccc6c60a872a314b19ac17702065a71d6bd (diff)
assume parse_commit checks commit->object.parsed
The parse_commit function will check the "parsed" flag of the object and do nothing if it is set. There is no need for callers to check the flag themselves, and doing so only clutters the code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/blame.c3
-rw-r--r--builtin/name-rev.c3
-rw-r--r--builtin/show-branch.c3
-rw-r--r--fetch-pack.c8
4 files changed, 6 insertions, 11 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 079dcd3407..4d25466509 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1554,8 +1554,7 @@ static void assign_blame(struct scoreboard *sb, int opt)
*/
origin_incref(suspect);
commit = suspect->commit;
- if (!commit->object.parsed)
- parse_commit(commit);
+ parse_commit(commit);
if (reverse ||
(!(commit->object.flags & UNINTERESTING) &&
!(revs->max_age != -1 && commit->date < revs->max_age)))
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 0aaa19e4ab..26f40330e3 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -27,8 +27,7 @@ static void name_rev(struct commit *commit,
struct commit_list *parents;
int parent_number = 1;
- if (!commit->object.parsed)
- parse_commit(commit);
+ parse_commit(commit);
if (commit->date < cutoff)
return;
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 9788eb115b..3afc79b2c3 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -227,8 +227,7 @@ static void join_revs(struct commit_list **list_p,
parents = parents->next;
if ((this_flag & flags) == flags)
continue;
- if (!p->object.parsed)
- parse_commit(p);
+ parse_commit(p);
if (mark_seen(p, seen_p) && !still_interesting)
extra--;
p->object.flags |= flags;
diff --git a/fetch-pack.c b/fetch-pack.c
index 6684348c0e..86b69775e3 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -46,9 +46,8 @@ static void rev_list_push(struct commit *commit, int mark)
if (!(commit->object.flags & mark)) {
commit->object.flags |= mark;
- if (!(commit->object.parsed))
- if (parse_commit(commit))
- return;
+ if (parse_commit(commit))
+ return;
prio_queue_put(&rev_list, commit);
@@ -127,8 +126,7 @@ static const unsigned char *get_rev(void)
return NULL;
commit = prio_queue_get(&rev_list);
- if (!commit->object.parsed)
- parse_commit(commit);
+ parse_commit(commit);
parents = commit->parents;
commit->object.flags |= POPPED;