git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Suchánek" <msuchanek@suse.de>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] setup: don't fail if commondir is deleted.
Date: Mon, 18 Feb 2019 09:54:23 +0100	[thread overview]
Message-ID: <20190218095423.0705aa7a@naga> (raw)
In-Reply-To: <CAPig+cTS0MNvwx67ZVbYUvi9bA63KWnNnSmWdFjLuqc_SNAy8A@mail.gmail.com>

On Sun, 17 Feb 2019 02:14:14 -0500
Eric Sunshine <sunshine@sunshineco.com> wrote:

> On Fri, Feb 15, 2019 at 1:16 PM Michal Suchanek <msuchanek@suse.de> wrote:
> > When adding wotktrees git can die in get_common_dir_noenv while
> > examining existing worktrees because the commondir file does not exist.
> > Handle ENOENT so adding a worktree does not fail because of incompletely
> > set-up other worktree.
> >
> > Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> > ---
> > diff --git a/setup.c b/setup.c
> > @@ -274,22 +274,25 @@ int get_common_dir_noenv(struct strbuf *sb, const char *gitdir)
> > +               if (strbuf_read_file(&data, path.buf, 0) <= 0) {
> > +                       if (errno != ENOENT)
> > +                               die_errno(_("failed to read %s"), path.buf);  
> 
> Documentation for strbuf_read_file() in strbuf.h does not state that
> 'errno' has any meaningful value when this function fails, however,

It is stated in the documentation of strbuf_read().

Thanks

Michal

  reply	other threads:[~2019-02-18  8:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 18:16 [PATCH 1/2] worktree: fix worktree add race Michal Suchanek
2019-02-15 18:16 ` [PATCH 2/2] setup: don't fail if commondir is deleted Michal Suchanek
2019-02-17  7:14   ` Eric Sunshine
2019-02-18  8:54     ` Michal Suchánek [this message]
2019-02-15 18:59 ` [PATCH 1/2] worktree: fix worktree add race Junio C Hamano
2019-02-16  0:18   ` Michal Suchánek
2019-02-17  7:05   ` Eric Sunshine

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=20190218095423.0705aa7a@naga \
    --to=msuchanek@suse.de \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /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).