Skip to content

Commit

Permalink
annotate: fix -S parameter to take a string
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Langhoff authored and Junio C Hamano committed Mar 2, 2006
1 parent 7c3ecb6 commit 0093154
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-annotate.perl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ()
my $rc = GetOptions( "long|l" => \$longrev,
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S" => \$rev_file);
"rev-file|S=s" => \$rev_file);
if (!$rc or $help) {
usage();
}
Expand Down Expand Up @@ -174,7 +174,8 @@ sub git_rev_list {

my $revlist;
if ($rev_file) {
open($revlist, '<' . $rev_file);
open($revlist, '<' . $rev_file)
or die "Failed to open $rev_file : $!";
} else {
$revlist = open_pipe("git-rev-list","--parents","--remove-empty",$rev,"--",$file)
or die "Failed to exec git-rev-list: $!";
Expand Down

0 comments on commit 0093154

Please sign in to comment.