git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions

From
Stefan Beller <sbeller@google.com>
Date
Jul 31, 2015, 23:40 UTC
Message-ID
<CAGZ79kZ-e-GU5FfKWDAUxQPUnyrmGjSvHGnjWn=pwpDAj37umQ@mail.gmail.com>
In-Reply-To
<1438322781-21181-3-git-send-email-dturner@twopensource.com>

I am sorry for being late to the review, I looked into coverity today as Duy bugged me to fix the memory allocation stuff[1]

[1] $gmane/275046
On Thu, Jul 30, 2015 at 11:06 PM, David Turner <dturner@twopensource.com> wrote:
> +
> +       if (old_sha1) {
> +               unsigned char actual_old_sha1[20];
> +               read_ref(pseudoref, actual_old_sha1);

What about the return value of read_ref? In most cases of the code base (19/21) we check the return of that. So maybe

    if (read_ref(pseudoref, actual_old_sha1) <0)
        die("Could not read ref %s", pseudoref);
> +               if (fd < 0)
> +                       die_errno(_("Could not open '%s' for writing"), filename);
> +               read_ref(pseudoref, actual_old_sha1);
same here.
Previous: David TurnerNext: David Turner
Message 7 of 13 in “refs: introduce pseudoref and per-worktree ref concepts”
  1. 1/5 refs: introduce pseudoref and per-worktree ref conceptsDavid Turner, Jul 31, 2015
  2. 2/5 refs: add ref_type functionDavid Turner, Jul 31, 2015
  3. Duy NguyenAug 3, 2015
  4. David TurnerAug 3, 2015
  5. David TurnerAug 11, 2015
  6. 3/5 pseudorefs: create and use pseudoref update and delete functionsDavid Turner, Jul 31, 2015
  7. Stefan BellerJul 31, 2015
  8. David TurnerAug 11, 2015
  9. Junio C HamanoAug 11, 2015
  10. Junio C HamanoAug 11, 2015
  11. David TurnerAug 11, 2015
  12. 4/5 bisect: use update_refDavid Turner, Jul 31, 2015
  13. 5/5 sequencer: replace write_cherry_pick_head with update_refDavid Turner, Jul 31, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.