Re: [PATCH 2/2] cvsimport: cleanup commit function
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 23, 2006, 20:25 UTC
- Message-ID
- <7vsln04hf0.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0605231232360.5623@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 7 quoted lines
>> Committing initial tree 34bd3dcd4bfd79bad35ce3fb08b2e21108195db8 >> Server has gone away while fetching BUGS-TODO 1.1, retrying... >... > Martin, that problem seems to go away when I initialize $res to 0 in > _fetchfile. > > I don't know perl, and maybe local variables are pre-initialized to empty.
When a new file that is empty is created, sub _line would call sub _fetchfile with $cnt == 0, and it can return $res which is initialized to 'undef'. That explains why sub file says $self->_line() returned an undef and I think what you did is the right fix.