-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCommitFileTester.java
More file actions
65 lines (48 loc) · 1.73 KB
/
CommitFileTester.java
File metadata and controls
65 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
public class CommitFileTester {
public static void main(String[] args) throws Exception {
Commit c = new Commit("Billy", "W Billy Commit!");
c.commitFile();
c.writeFile();
c.tree.add("yo.txt");
c.tree.add("jump.txt");
c.commitFile();
c.writeFile();
c.seePrev();
c.writeFile();
File directory = new File("/Users/lilbarbar/Desktop/Honors Topics/Programming-Git/Tree-Objects");
String start = "/Users/lilbarbar/Desktop/Honors Topics/Programming-Git/Tree-Objects/";
String contents[] = directory.list();
int goodFiles = 0;
for (String s : contents) {
File file = new File(start + s);
String info = Helper.fileContents(file);
if (info.indexOf("Next") != -1 || info.indexOf("Previous") != -1 ||
info.indexOf("Current") != -1) {
goodFiles++;
}
}
System.out.println("\f");
Commit c2 = new Commit("Billy", "W Billy Commit!");
c2.commitFile();
c2.writeFile();
c2.tree.add("tesout.txt");
c2.tree.add("Hehe");
c2.tree.add("FolderB");
c2.commitFile();
c2.writeFile();
c2.seePrev();
c2.writeFile();
goodFiles = 0;
String contents2[] = directory.list();
for (String s : contents2) {
File file = new File(start + s);
String info = Helper.fileContents(file);
if (info.indexOf("Next") != -1 || info.indexOf("Previous") != -1 || info.indexOf("Current") != -1) {
goodFiles++;
}
}
}
}