user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 4/9] solver: path_a may be undef from /dev/null
  2020-01-11 22:34  4% [PATCH 0/9] more small fixes and cleanups Eric Wong
@ 2020-01-11 22:34  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-01-11 22:34 UTC (permalink / raw)
  To: meta

This avoids uninitialized variable warnings when viewing
newly-created files.
---
 lib/PublicInbox/SolverGit.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index 8629f0da..62c925d4 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -169,7 +169,7 @@ sub extract_diff ($$) {
 	my $patch = $9;
 
 	# don't care for leading 'a/' and 'b/'
-	my (undef, @a) = split(m{/}, git_unquote($path_a));
+	my (undef, @a) = split(m{/}, git_unquote($path_a)) if defined($path_a);
 	my (undef, @b) = split(m{/}, git_unquote($path_b));
 
 	# get rid of path-traversal attempts and junk patches:
@@ -177,7 +177,7 @@ sub extract_diff ($$) {
 	state $bad_component = { map { $_ => 1 } ('', '.', '..') };
 	foreach (@a, @b) { return if $bad_component->{$_} }
 
-	$di->{path_a} = join('/', @a);
+	$di->{path_a} = join('/', @a) if @a;
 	$di->{path_b} = join('/', @b);
 
 	my $path = ++$self->{tot};

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/9] more small fixes and cleanups
@ 2020-01-11 22:34  4% Eric Wong
  2020-01-11 22:34  7% ` [PATCH 4/9] solver: path_a may be undef from /dev/null Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-01-11 22:34 UTC (permalink / raw)
  To: meta

One bugfix for solver, a couple of optimizations which will
make sense when dealing with many and larger code repos.
And some cleanups to reduce redundant code.

Eric Wong (9):
  config: do not slurp entire cgitrc at once
  git: modified: don't slurp `rev-parse --branches'
  git: packed_bytes: use GLOB_NOSORT
  solver: path_a may be undef from /dev/null
  cgit: drop cgit_parse_hdr wrapper
  xapcmd: use popen_rd for running xapian-compact
  xt/git_async_cmp: do not slurp large OID list into memory
  t/solver_git: avoid uninitialized warnings in hostname generation
  use popen_rd for bidirectional pipes

 lib/PublicInbox/Cgit.pm       |  9 ++-------
 lib/PublicInbox/Config.pm     |  4 ++--
 lib/PublicInbox/Git.pm        | 24 +++++++++++-------------
 lib/PublicInbox/Import.pm     |  8 +++-----
 lib/PublicInbox/SolverGit.pm  |  4 ++--
 lib/PublicInbox/V2Writable.pm | 11 +++--------
 lib/PublicInbox/Xapcmd.pm     | 16 +++++-----------
 t/solver_git.t                | 12 ++++++------
 xt/git_async_cmp.t            |  4 ++--
 9 files changed, 36 insertions(+), 56 deletions(-)

DELETE! DELETE! DELETE!

^ permalink raw reply	[relevance 4%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-01-11 22:34  4% [PATCH 0/9] more small fixes and cleanups Eric Wong
2020-01-11 22:34  7% ` [PATCH 4/9] solver: path_a may be undef from /dev/null Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).