Commit 8f31fac
builtin/apply: add 'lock_file' pointer into 'struct apply_state'
We cannot have a 'struct lock_file' allocated on the stack, as lockfile.c
keeps a linked list of all created lock_file structures.
Also 'struct apply_state' users might later want the same 'struct lock_file'
instance to be reused by different series of calls to the apply api.
So let's add a 'struct lock_file *lock_file' pointer into 'struct apply_state'
and have the user of 'struct apply_state' allocate memory for the actual
'struct lock_file' instance.
Let's also add an argument to init_apply_state(), so that the caller can
easily supply a pointer to the allocated instance.
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 91b769c commit 8f31fac
1 file changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
4547 | 4553 | | |
4548 | 4554 | | |
4549 | 4555 | | |
4550 | | - | |
| 4556 | + | |
4551 | 4557 | | |
4552 | 4558 | | |
4553 | 4559 | | |
| |||
4648 | 4654 | | |
4649 | 4655 | | |
4650 | 4656 | | |
4651 | | - | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
4652 | 4660 | | |
4653 | 4661 | | |
4654 | 4662 | | |
4655 | 4663 | | |
| 4664 | + | |
4656 | 4665 | | |
4657 | 4666 | | |
4658 | 4667 | | |
| |||
4705 | 4714 | | |
4706 | 4715 | | |
4707 | 4716 | | |
| 4717 | + | |
| 4718 | + | |
4708 | 4719 | | |
4709 | 4720 | | |
4710 | 4721 | | |
| |||
4769 | 4780 | | |
4770 | 4781 | | |
4771 | 4782 | | |
4772 | | - | |
| 4783 | + | |
4773 | 4784 | | |
4774 | 4785 | | |
4775 | 4786 | | |
| |||
4852 | 4863 | | |
4853 | 4864 | | |
4854 | 4865 | | |
4855 | | - | |
| 4866 | + | |
4856 | 4867 | | |
4857 | 4868 | | |
4858 | 4869 | | |
| |||
0 commit comments