diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-12-11 11:14:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-11 11:14:13 -0800 |
commit | 0af22d6fffe5169f641fb9815468ae97e47cd73f (patch) | |
tree | e61f2ffb0f66e0d8c5892c0795b6f8a521e4f2c9 /upload-pack.c | |
parent | 8c0a546670a2cb2349c5baedbf4b87268e52c665 (diff) | |
parent | e510ab898865fdaf131e9bc9fd6ab6b7c4a94c9b (diff) | |
download | git-0af22d6fffe5169f641fb9815468ae97e47cd73f.tar.gz git-0af22d6fffe5169f641fb9815468ae97e47cd73f.tar.xz |
Merge branch 'rs/pop-commit' into maint
Code simplification.
* rs/pop-commit:
use pop_commit() for consuming the first entry of a struct commit_list
Diffstat (limited to 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/upload-pack.c b/upload-pack.c index 89e832b64..d0bc3ca07 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; |