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:
authorRené Scharfe <l.s.r@web.de>2015-10-24 19:21:31 +0300
committerJunio C Hamano <gitster@pobox.com>2015-10-27 00:06:46 +0300
commite510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (patch)
treee189dbe7cc56b89b1d8c2e1d884db8d1da6e4a8b /upload-pack.c
parent24358560c3c0ab51c9ef8178d99f46711716f6c0 (diff)
use pop_commit() for consuming the first entry of a struct commit_list
Instead of open-coding the function pop_commit() just call it. This makes the intent clearer and reduces code size. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 89e832b64a..d0bc3ca07a 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -316,10 +316,8 @@ static int reachable(struct commit *want)
commit_list_insert_by_date(want, &work);
while (work) {
- struct commit_list *list = work->next;
- struct commit *commit = work->item;
- free(work);
- work = list;
+ struct commit_list *list;
+ struct commit *commit = pop_commit(&work);
if (commit->object.flags & THEY_HAVE) {
want->object.flags |= COMMON_KNOWN;