diff options
author | Martin Langhoff <martin@catalyst.net.nz> | 2006-03-02 17:24:30 +1300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-03-01 21:33:27 -0800 |
commit | 009315499e789d241998fcc5add1f109af8ba0e6 (patch) | |
tree | e01a69b993b62d09a2ca80cb1ba2142ea1379c7b /git-annotate.perl | |
parent | 7c3ecb65eec9ff2c39c781958bf50ed6541e1332 (diff) | |
download | git-009315499e789d241998fcc5add1f109af8ba0e6.tar.gz |
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>
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-x | git-annotate.perl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-annotate.perl b/git-annotate.perl index d6028c93ca..cd476c7629 100755 --- a/git-annotate.perl +++ b/git-annotate.perl @@ -31,7 +31,7 @@ our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1); 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(); } @@ -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: $!"; |