Skip to content

Commit

Permalink
pack_refs(): remove redundant check
Browse files Browse the repository at this point in the history
handle_one_ref() only adds refs to the cbdata.ref_to_prune list if
(cbdata.flags & PACK_REFS_PRUNE) is set.  So any references in this
list at the end of pack_refs() can be pruned unconditionally.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
mhagger authored and gitster committed Jan 17, 2012
1 parent 6db5c6e commit e45a599
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pack-refs.c
Expand Up @@ -143,7 +143,6 @@ int pack_refs(unsigned int flags)
packed.fd = -1;
if (commit_lock_file(&packed) < 0)
die_errno("unable to overwrite old ref-pack file");
if (cbdata.flags & PACK_REFS_PRUNE)
prune_refs(cbdata.ref_to_prune);
prune_refs(cbdata.ref_to_prune);
return 0;
}

0 comments on commit e45a599

Please sign in to comment.