Skip to content

Commit

Permalink
fixed diff for initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tg-x committed Jun 5, 2013
1 parent 27a3a6e commit c71483d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/gitzone
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ sub check_what_changed {
my ($old, $new) = @_;

# diff with empty tree if there's no previous commit
$old = '4b825dc642cb6eb9a060e54bf8d69288fbee4904' if !$old || $old =~ /^0+$/;

$_ = git "diff --raw ". ($new ? "$old..$new" : $old);
if (!$old || $old =~ /^0+$/) {
$_ = git "diff-tree --root $new";
} else {
$_ = git "diff --raw --abbrev=40 ". ($new ? "$old..$new" : $old);
}

# parse diff output, add only valid zone names to %files for parsing
$files{$1} = 0 while m,^:(?:[\w.]+\s+){5}([a-z0-9./-]+)$,gm;
Expand Down

0 comments on commit c71483d

Please sign in to comment.