summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Mitz <mitza@ociweb.com>2015-09-09 10:43:26 -0500
committerAdam Mitz <mitza@ociweb.com>2015-09-09 10:43:26 -0500
commit133850bf8c710a14fd0600060b1ab75c10b7e36a (patch)
treee4f94c37b6dc6421940fc7209e89224c649a1e2c
parent2a231f8ba36eda2dc6db470ea4c490a2d61c7f11 (diff)
parent99c0673e9717753033d328625110fc08e5601ebc (diff)
downloadATCD-133850bf8c710a14fd0600060b1ab75c10b7e36a.tar.gz
Merge pull request #130 from iamtheschmitzer/master
make fuzz.pl -m work for GIT repos also
-rwxr-xr-xACE/bin/fuzz.pl33
1 files changed, 30 insertions, 3 deletions
diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl
index cbac6b6b19e..89120aea20a 100755
--- a/ACE/bin/fuzz.pl
+++ b/ACE/bin/fuzz.pl
@@ -67,13 +67,13 @@ $warnings = 0;
##############################################################################
-# Find_Modified_Files will use 'svn -q st' to get a list of locally modified
+# Use 'svn -q st' to get a list of locally modified
# files to look through
-sub find_mod_files ()
+sub find_mod_svn_files ()
{
unless (open (SVN, "svn -q st |")) {
print STDERR "Error: Could not run svn\n";
- exit (1);
+ return 0;
}
while (<SVN>) {
@@ -83,6 +83,33 @@ sub find_mod_files ()
}
}
close (SVN);
+ return 1;
+}
+
+# Use 'git status -s' to get a list of locally modified
+# files to look through
+sub find_mod_git_files ()
+{
+ unless (open (GIT, "git status -s |")) {
+ print STDERR "Error: Could not run git\n";
+ return 0;
+ }
+
+ while (<GIT>) {
+ if (/^ [MA] +(.*)$/) {
+ store_file ($1);
+ }
+ }
+ close (GIT);
+ return 1;
+}
+
+sub find_mod_files ()
+{
+ if (!(find_mod_svn_files() && find_mod_git_files())) {
+ print "Could use neither svn nor git to find modified files\n";
+ exit (1);
+ }
}