annotate: fix -S parameter to take a string
In the conversion to Getopt::Long, the -S / --rev-list parameter stopped working. We need to tell Getopt::Long that it is a string. As a bonus, the open() now does some useful error handling. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
7c3ecb65ee
commit
009315499e
@ -31,7 +31,7 @@ our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1);
|
|||||||
my $rc = GetOptions( "long|l" => \$longrev,
|
my $rc = GetOptions( "long|l" => \$longrev,
|
||||||
"help|h" => \$help,
|
"help|h" => \$help,
|
||||||
"rename|r" => \$rename,
|
"rename|r" => \$rename,
|
||||||
"rev-file|S" => \$rev_file);
|
"rev-file|S=s" => \$rev_file);
|
||||||
if (!$rc or $help) {
|
if (!$rc or $help) {
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
@ -174,7 +174,8 @@ sub git_rev_list {
|
|||||||
|
|
||||||
my $revlist;
|
my $revlist;
|
||||||
if ($rev_file) {
|
if ($rev_file) {
|
||||||
open($revlist, '<' . $rev_file);
|
open($revlist, '<' . $rev_file)
|
||||||
|
or die "Failed to open $rev_file : $!";
|
||||||
} else {
|
} else {
|
||||||
$revlist = open_pipe("git-rev-list","--parents","--remove-empty",$rev,"--",$file)
|
$revlist = open_pipe("git-rev-list","--parents","--remove-empty",$rev,"--",$file)
|
||||||
or die "Failed to exec git-rev-list: $!";
|
or die "Failed to exec git-rev-list: $!";
|
||||||
|
Reference in New Issue
Block a user