git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: David Turner <dturner@twopensource.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions
Date: Fri, 31 Jul 2015 16:40:16 -0700	[thread overview]
Message-ID: <CAGZ79kZ-e-GU5FfKWDAUxQPUnyrmGjSvHGnjWn=pwpDAj37umQ@mail.gmail.com> (raw)
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.

  reply	other threads:[~2015-07-31 23:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  6:06 [PATCH v5 1/5] refs: introduce pseudoref and per-worktree ref concepts David Turner
2015-07-31  6:06 ` [PATCH v5 2/5] refs: add ref_type function David Turner
2015-08-03 13:55   ` Duy Nguyen
2015-08-03 20:44     ` David Turner
2015-08-11 18:39     ` David Turner
2015-07-31  6:06 ` [PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions David Turner
2015-07-31 23:40   ` Stefan Beller [this message]
2015-08-11 18:46     ` David Turner
2015-08-11 22:32       ` Junio C Hamano
2015-08-11 22:47         ` Junio C Hamano
2015-08-11 22:53           ` David Turner
2015-07-31  6:06 ` [PATCH v5 4/5] bisect: use update_ref David Turner
2015-07-31  6:06 ` [PATCH v5 5/5] sequencer: replace write_cherry_pick_head with update_ref David Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGZ79kZ-e-GU5FfKWDAUxQPUnyrmGjSvHGnjWn=pwpDAj37umQ@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=dturner@twopensource.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).