From: Wayne Davison Date: Mon, 4 Feb 2008 08:12:01 +0000 (-0800) Subject: Fixed finding of parent's description when @ARGV doesn't mention it. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/970ce063ee0c17b69ee5343d6934faab479f6ed8 Fixed finding of parent's description when @ARGV doesn't mention it. --- diff --git a/support/patch-update b/support/patch-update index 502380df..a76f111d 100755 --- a/support/patch-update +++ b/support/patch-update @@ -56,16 +56,9 @@ if ($incl_generated_files) { my $last_touch = time; my(@patches, %local_patch); -if (@ARGV) { - foreach (@ARGV) { - s{^(patches|patch|origin/patch)/} {}; - s{\.diff$} {}; - push(@patches, $_); - } - open(PIPE, '-|', 'git', 'branch', '-l') or die $!; -} else { - open(PIPE, '-|', 'git', 'branch', '-a') or die $!; -} + +# Start by finding all patches so that we can load all possible parents. +open(PIPE, '-|', 'git', 'branch', '-a') or die $!; while () { if (m# origin/patch/(.*)#) { push(@patches, $1); @@ -93,6 +86,16 @@ foreach my $patch (@patches) { $description{$patch} = $desc; } +if (@ARGV) { + # Limit the list of patches to actually process based on @ARGV. + @patches = ( ); + foreach (@ARGV) { + s{^(patches|patch|origin/patch)/} {}; + s{\.diff$} {}; + push(@patches, $_); + } +} + my %completed; foreach my $patch (@patches) { next if $completed{$patch}++;