Re: [PATCH] git-svn: avoid warning on undef readline()
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Apr 7, 2018, 19:20 UTC
- Message-ID
- <20180407192022.GD9954@genre.crustytoothpaste.net>
- In-Reply-To
- <20180406131514.740-1-avarab@gmail.com>
On Fri, Apr 06, 2018 at 01:15:14PM +0000, Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
> Change code in Git.pm that sometimes calls chomp() on undef to only do
> so the value is defined.
>
> This code has been chomping undef values ever since it was added in
> b26098fc2f ("git-svn: reduce scope of input record separator change",
> 2016-10-14), but started warning due to the introduction of "use
> warnings" to Git.pm in my f0e19cb7ce ("Git.pm: add the "use warnings"
> pragma", 2018-02-25) released with 2.17.0.
>
> Since this function will return undef in those cases it's still
> possible that the code using it will warn if it does a chomp of its
> own, as the code added in b26098fc2f ("git-svn: reduce scope of input
> record separator change", 2016-10-14) might do, but since git-svn has
> "use warnings" already that's clearly not a codepath that's going to
> warn.Thanks for this patch. I ran into this earlier this week (with git svn fetch) and had intended to send a patch, but you clearly got to it before I did.
-- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204