summaryrefslogtreecommitdiff
path: root/git-annotate.perl
diff options
context:
space:
mode:
authorLibravatar Martin Langhoff <martin@catalyst.net.nz>2006-05-01 10:20:56 +1200
committerLibravatar Martin Langhoff <martin@catalyst.net.nz>2006-05-01 10:20:56 +1200
commite660e3997fbad830e5723336d61883f3a50dbc92 (patch)
tree0c02dced98df9982415c8328e8c07c1001e3dc31 /git-annotate.perl
parentgit-cvsexportcommit: Add -f(orce) and -m(essage prefix) flags, small cleanups. (diff)
parentMerge branch 'fix' (diff)
downloadtgif-e660e3997fbad830e5723336d61883f3a50dbc92.tar.xz
Merge with git://kernel.org/pub/scm/git/git.git
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-xgit-annotate.perl10
1 files changed, 7 insertions, 3 deletions
diff --git a/git-annotate.perl b/git-annotate.perl
index 9df72a1662..a6a7a482cd 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -10,9 +10,10 @@ use warnings;
use strict;
use Getopt::Long;
use POSIX qw(strftime gmtime);
+use File::Basename qw(basename dirname);
sub usage() {
- print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
+ print STDERR "Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
-l, --long
Show long rev (Defaults off)
-t, --time
@@ -23,7 +24,7 @@ sub usage() {
Use revs from revs-file instead of calling git-rev-list
-h, --help
This message.
-';
+";
exit(1);
}
@@ -35,7 +36,7 @@ my $rc = GetOptions( "long|l" => \$longrev,
"help|h" => \$help,
"rename|r" => \$rename,
"rev-file|S=s" => \$rev_file);
-if (!$rc or $help) {
+if (!$rc or $help or !@ARGV) {
usage();
}
@@ -208,6 +209,9 @@ sub find_parent_renames {
while (my $change = <$patch>) {
chomp $change;
my $filename = <$patch>;
+ if (!defined $filename) {
+ next;
+ }
chomp $filename;
if ($change =~ m/^[AMD]$/ ) {