Skip to content

Commit

Permalink
fix checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
ffanyt authored Jan 25, 2023
1 parent 54b594c commit 5c933e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proj2/gitlet/Repository.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public static void checkout(String cm, int select) {
if (select == 0) {
chechBranchExit(cm);
File branchFILE = join(BRANCH_DIR, cm);
String branchInfo = readObject(branchFILE, String.class);
String branchInfo = readContentsAsString(branchFILE);
//String branchInfo = readObject(branchFILE, String.class);
if (branchInfo.equals(HEAD)) {
printError("No need to checkout the current branch.");
}
Expand Down

0 comments on commit 5c933e7

Please sign in to comment.