Re: [RFC/PATCH] bisect--helper: `bisect_clean_state` shell function in C
- From
Christian Couder <christian.couder@gmail.com>
- Date
- May 30, 2016, 21:48 UTC
- Message-ID
- <CAP8UFD2wAKN2CsfndLNeCb1dAEH5H-wj_6spAm+d_AtBQDZfhQ@mail.gmail.com>
- In-Reply-To
- <20160530182148.18801-1-pranit.bauva@gmail.com>
On Mon, May 30, 2016 at 8:21 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
Show 8 quoted lines
> --- > This patch contains a bug. I have tried to identify the bug and I suppose it > exists in do_for_each_entry_in_dir(). I have reproduced the debugging session > at this link[1]. I have seen that some patches in mailing list regarding > iterating over refs. Will those affect this? Or is this bug fixed in those > patches? > > [1]: http://paste.ubuntu.com/16830752/
The debug session seems to use code source from a previous version of this patch. Also it is not cear in which context you run git under gdb. What have you done before? And we don't see a crash. Could you show the crash and run the "bt" command in gdb to get a backtrace?
Show 10 quoted lines
> @@ -79,11 +90,42 @@ int write_terms(const char *bad, const char *good)
> strbuf_release(&content);
> return (res < 0) ? -1 : 0;
> }
> +
> +int remove_bisect_ref(const char *refname, const struct object_id *oid,
> + int flag, void *cb_data)
> +{
> + char *ref;
> + ref = xstrfmt("refs/bisect/%s", refname);You could save one line by concatenating the 2 above lines.
> + if (delete_ref(ref, oid->hash, flag))
> + return error(_("couldn't delete the ref %s\n"), ref);
> + return 0;You need to free "ref".
> +}
Thanks, Christian.