Skip to content

Commit 0093154

Browse files
Martin LanghoffJunio C Hamano
authored andcommitted
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>
1 parent 7c3ecb6 commit 0093154

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git-annotate.perl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ()
3131
my $rc = GetOptions( "long|l" => \$longrev,
3232
"help|h" => \$help,
3333
"rename|r" => \$rename,
34-
"rev-file|S" => \$rev_file);
34+
"rev-file|S=s" => \$rev_file);
3535
if (!$rc or $help) {
3636
usage();
3737
}
@@ -174,7 +174,8 @@ sub git_rev_list {
174174

175175
my $revlist;
176176
if ($rev_file) {
177-
open($revlist, '<' . $rev_file);
177+
open($revlist, '<' . $rev_file)
178+
or die "Failed to open $rev_file : $!";
178179
} else {
179180
$revlist = open_pipe("git-rev-list","--parents","--remove-empty",$rev,"--",$file)
180181
or die "Failed to exec git-rev-list: $!";

0 commit comments

Comments
 (0)