Re: [PATCH] git-relink.perl: warn() instead of die() on directory open failure
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2008, 02:14 UTC
- Message-ID
- <7vabnbzt6t.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <4787B15D.3070105@nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 7 quoted lines
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> > --- > > > Sometimes the repository to link to is not under your control. > If it contains files or unreadable directories, git-relink will > die without this patch.
I am not so sure if dying is a bad behaviour, if it is because you are trying to link against an object store that you may not be able to read. I actually think we should actively refuse to, in order to prevent future problems. After seeing the command die, you will talk to the owner of that "master" object store and ask him to fix permissions (or he may choose to say "please do not share with me").
However, if the "master" object store has pruned its loose objects since you read @hashdirs out of it, that opendir() can fail, and we should silently ignore the whole $subdir.