-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (22 loc) · 751 Bytes
/
main.cpp
File metadata and controls
32 lines (22 loc) · 751 Bytes
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
#include <iostream>
#include <components/Repository.h>
int main() {
std::cout << "Hello, Split Version Control System!" << std::endl;
Split::Repository repo("test_repo");
repo.init();
// Simulate adding a file and committing
std::ofstream file("test_repo/file.txt");
file << "This is a test file." << std::endl;
file.close();
repo.add("file.txt");
repo.commit("Initial commit", "Author Name");
// Modify the file
file.open("test_repo/file.txt", std::ios::app);
file << "Adding more content." << std::endl;
file.close();
repo.add("file.txt");
repo.commit("Updated file.txt", "Author Name");
auto history = repo.getCommitHistory();
repo.checkout(history[0]);
return 0;
}