|
@@ -82,6 +82,18 @@ sub get_file_tree($$) {
|
|
|
my %file_content;
|
|
|
foreach my $filename ( keys %file_tree ) {
|
|
|
my $content = shellex("$gitCmd --git-dir=\"$projectDir\" show $file_tree{$filename}",$logger);
|
|
|
+ # - TODO -
|
|
|
+ # A hack -- interested in a better way to detect if git files are binary
|
|
|
+ # Also dramatically increases run time (~3 seconds additional run time, will likely ballon on bigger git repos)
|
|
|
+ my $file_cmd = findBin("file",$logger);
|
|
|
+ my $rm_cmd = findBin("rm",$logger);
|
|
|
+ my $test_write_path = "/tmp/test";
|
|
|
+ my $bin_test = shellex("$gitCmd --git-dir=\"$projectDir\" show $file_tree{$filename} > $test_write_path && $file_cmd -i $test_write_path && $rm_cmd $test_write_path",$logger);
|
|
|
+
|
|
|
+ if ( $bin_test !~ m/text/ ) {
|
|
|
+ $content = "Binary file";
|
|
|
+ }
|
|
|
+
|
|
|
chomp $content;
|
|
|
# Name - file content
|
|
|
$file_content{$filename} = $content;
|