Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Commit 5f29409

Browse files
committed
Rename tag methods to include create prefix
1 parent 36a444e commit 5f29409

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Sources/Git/Repository.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ public final class Repository {
209209
}
210210

211211
/// Creates a lightweight tag.
212-
public func tag(name: String, target: Object, force: Bool = false) throws {
212+
public func createLightweightTag(named name: String, target: Object, force: Bool = false) throws {
213213
let _ = try Object.ID { oid in
214214
try attempt { git_tag_create_lightweight(oid, self.pointer, name, target.pointer, force ? 1 : 0) }
215215
}
216216
}
217217

218218
/// Creates an annotated tag.
219-
public func tag(name: String, target: Object, tagger: Signature? = nil, message: String, force: Bool = false) throws {
219+
public func createAnnotatedTag(named name: String, target: Object, tagger: Signature? = nil, message: String, force: Bool = false) throws {
220220
var signature = try (tagger ?? Signature.default(for: self)).rawValue
221221
let _ = try Object.ID { oid in
222222
try attempt { git_tag_create(oid, self.pointer, name, target.pointer, &signature, message, force ? 1 : 0) }

Tests/GitTests/GitTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ final class GitTests: XCTestCase {
101101
let note = try commit.add(note: #"{"test": true }"#, author: signature, committer: signature)
102102
XCTAssertNotNil(note?.message, #"{"test": true }"#)
103103

104-
try repository.tag(name: "0.0.1", target: commit)
104+
try repository.createLightweightTag(named: "0.0.1", target: commit)
105105
let names = try repository.tagNames()
106-
XCTAssertFalse(names.isEmpty)
107106
XCTAssert(names.contains("0.0.1"))
108107
}
109108
}

0 commit comments

Comments
 (0)