Skip to content

Commit

Permalink
Parse renamed files out of the diff output.
Browse files Browse the repository at this point in the history
Normally, you see diff output like:

remote: :000000 100644 0000000000000000000000000000000000000000 cbdbdf73ffcdfc5fb1534831101eba6e11726939 A	default/example.com

However if you get a rename, you end up with something like:

remote: :100644 100644 fe42721d2c44d873f9df508487e3e0d39ea736cd 0967c377247736e75cac903f84b2bf411d79f062 R099	zones/example.com.COMMON.db	common/example.com.COMMON.db

Previously, this would cause gitzone to fail to pick up that this file
had potentially changed, even if there were commits with edits to either
the old or new name as part of the push.

We now catch this case and grab the second name, letting us handle these
pushes properly.
  • Loading branch information
Zephaniah E. Loss-Cutler-Hull committed Nov 9, 2017
1 parent 967ae1f commit d8a13db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/gitzone
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ sub check_what_changed {
}

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

sub process_files {
Expand Down

0 comments on commit d8a13db

Please sign in to comment.