forked from eluhnow1/git-project-edwin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitInterface.java
More file actions
33 lines (28 loc) · 1.22 KB
/
GitInterface.java
File metadata and controls
33 lines (28 loc) · 1.22 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
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
public interface GitInterface {
/**
* Stages a file for the next commit.
*
* @param filePath The path to the file to be staged.
*/
void stage(String filePath) throws IOException, NoSuchAlgorithmException;
/**
* Creates a commit with the given author and message.
* It should capture the current state of the repository,
* update the HEAD, and return the commit hash.
*
* @param author The name of the author making the commit.
* @param message The commit message describing the changes.
* @return The SHA1 hash of the new commit.
*/
String commit(String author, String message) throws IOException, NoSuchAlgorithmException;
/**
* EXTRA CREDIT: Checks out a specific commit given its hash.
* This should update the working directory to match the
* state of the repository at that commit.
*
* @param commitHash The SHA1 hash of the commit to check out.
*/
//void checkout(String commitHash) throws IOException, NoSuchAlgorithmException;
}