Re: [PATCH] rewrite finish_bulk_checkin() using strbuf
- From
- Faiz Kothari <faiz.off93@gmail.com>
- Date
- Mar 1, 2014, 11:20 UTC
- Message-ID
- <CAFbjVcnM8a9pOmkt1ERZ-5mxek6+uP5ZPabwz1EqBFxO=VCJVw@mail.gmail.com>
- In-Reply-To
- <CAJr59C2SpT_=-tDq1yQSt8j1TNy9vOugw-tusC=KBUnYfjYfeg@mail.gmail.com>
On Sat, Mar 1, 2014 at 4:33 PM, He Sun <sunheehnus@gmail.com> wrote:
Show 11 quoted lines
> 2014-03-01 15:18 GMT+08:00 Faiz Kothari <faiz.off93@gmail.com>: >> Hi, >> Yup, at that position. >> I don't know, but it failed a few tests on my machine related to bitmap. >> Another thing to use would be strbuf_splice() > > Eric Sunshine<sunshine@sunshineco.com> has came up with a more > elegant way to finish this task. That's using strbuf_setlen() instead of > strbuf_remove(). Because of the unstable network of this afternoon. The > former email is sent without the above information. > Sorry about it.
You mean first use strbuf_setlen() to reduce len and then add ".whatever" to it? strbuf_splice can do strbuf_remove() and add string in one shot as per the doc. If using strbuf_setlen() is still better, I'll implement using that :)
> I find out that you didn't attach strbuf_remove() in your finish_bulk_checkin(). > That may cause problems not only related to bitmap, because the input > packname is different from the output packname.. >
I am not sure how that is causing the problem, because tests run just fine. I'll still look into it. Thanks for pointing that out :)
Cheers, Faiz