Skip to content

Commit 64f319c

Browse files
author
Andrew McKnight
committed
comments
1 parent b101640 commit 64f319c

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

Tests/GitKitTests/GitKitTests.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,29 +157,23 @@ final class GitKitTests: XCTestCase {
157157

158158
try self.clean(path: path)
159159
let git = Git(path: path)
160-
161-
// Initialize a repository and make an initial commit
160+
162161
try git.run(.raw("init"))
163162
try git.run(.commit(message: "initial commit", allowEmpty: true))
164-
165-
// Test 1: Get abbreviated reference name for HEAD
163+
166164
let abbrevRef = try git.run(.revParse(abbrevRef: true, revision: "HEAD"))
167165
XCTAssertEqual(abbrevRef, "main", "Should return abbreviated reference name")
168166

169-
// Test 2: Get full commit SHA for HEAD
170167
let fullSHA = try git.run(.revParse(abbrevRef: false, revision: "HEAD"))
171168
XCTAssertTrue(fullSHA.count == 40, "Should return full 40-character SHA")
172169
XCTAssertTrue(fullSHA.allSatisfy { $0.isHexDigit }, "SHA should contain only hex characters")
173-
174-
// Test 3: Parse symbolic reference (@)
170+
175171
let symbolicRef = try git.run(.revParse(abbrevRef: false, revision: "@"))
176172
XCTAssertEqual(symbolicRef, fullSHA, "Symbolic '@' should resolve to same SHA as HEAD")
177-
178-
// Test 4: Get abbreviated reference for current branch
173+
179174
let currentBranch = try git.run(.revParse(abbrevRef: true, revision: "@"))
180175
XCTAssertEqual(currentBranch, "main", "Should return current branch name")
181176

182-
// Clean up
183177
try self.clean(path: path)
184178
}
185179

0 commit comments

Comments
 (0)