+open(IN, '-|', 'git status') or die $!;
+my $status = join('', <IN>);
+close IN;
+unless ($skip_branch_check) {
+ die "The checkout is not clean:\n", $status unless $status =~ /\nnothing to commit \(working directory clean\)/;
+}
+my($starting_branch) = $status =~ /^# On branch (.+)\n/;
+
+my @extra_files;
+open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n";
+while (<IN>) {
+ if (s/^GENFILES=//) {
+ while (s/\\$//) {
+ $_ .= <IN>;
+ }
+ @extra_files = split(' ', $_);
+ last;
+ }
+}