Merge icon, delete-branch-after-merge setting, floating tab bar; bump to 2.0
Build iOS App / Build .ipa and publish source (push) Successful in 22s
Build iOS App / Build .ipa and publish source (push) Successful in 22s
- Merge button: use the proper SF Symbol 'arrow.triangle.merge' instead of the download icon 'arrow.down.circle'. - Add a Settings toggle 'Delete branch after merge'. When on, the merge call passes delete_branch_after_merge=true and the head branch is deleted after a successful merge (best-effort). - PR detail bottom tab bar: floating capsule style (regularMaterial + shadow) like the latest iOS tab bars, instead of a full-width bar. - Bump to 2.0.
This commit is contained in:
1 parent
fce0385708
commit
53b3f69d0f
6 files changed
+49
-12
No files matched your search
@@ -211,12 +211,23 @@ struct GiteaClient {
|
||||
}
|
||||
|
||||
func merge(owner: String, repo: String, number: Int,
|
||||
method: String) async throws {
|
||||
struct Body: Encodable { let Do: String } // 'Do' = merge method: merge|rebase|squash
|
||||
method: String, deleteBranchAfterMerge: Bool) async throws {
|
||||
struct Body: Encodable {
|
||||
let Do: String // merge|rebase|squash
|
||||
let delete_branch_after_merge: Bool
|
||||
}
|
||||
_ = try await request(
|
||||
"repos/\(owner)/\(repo)/pulls/\(number)/merge",
|
||||
method: "POST",
|
||||
body: try JSONEncoder().encode(Body(Do: method)))
|
||||
body: try JSONEncoder().encode(Body(Do: method,
|
||||
delete_branch_after_merge: deleteBranchAfterMerge)))
|
||||
}
|
||||
|
||||
/// Delete a branch (used after merging when the setting is enabled).
|
||||
func deleteBranch(owner: String, repo: String, branch: String) async throws {
|
||||
let encoded = branch.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? branch
|
||||
_ = try await request("repos/\(owner)/\(repo)/branches/\(encoded)",
|
||||
method: "DELETE")
|
||||
}
|
||||
|
||||
func setState(owner: String, repo: String, number: Int,
|
||||
|
||||
Reference in new issue
Block a user