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

Commit 2a16328

Browse files
committed
add addTag API
1 parent b2fa781 commit 2a16328

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎lib/Models/ProjectRepository.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
this.showCommit = bind(this.showCommit, this);
2222
this.listCommits = bind(this.listCommits, this);
2323
this.listTags = bind(this.listTags, this);
24+
this.showTag = bind(this.showTag, this);
2425
this.addTag = bind(this.addTag, this);
2526
this.deleteBranch = bind(this.deleteBranch, this);
2627
this.createBranch = bind(this.createBranch, this);
@@ -135,6 +136,20 @@
135136
})(this));
136137
};
137138

139+
ProjectRepository.prototype.showTag = function(projectId, tagName, fn) {
140+
if (fn == null) {
141+
fn = null;
142+
}
143+
this.debug("Projects::showTag()");
144+
return this.get("projects/" + (Utils.parseProjectId(projectId)) + "/repository/tags/" + (encodeURI(tagName)), (function(_this) {
145+
return function(data) {
146+
if (fn) {
147+
return fn(data);
148+
}
149+
};
150+
})(this));
151+
};
152+
138153
ProjectRepository.prototype.listTags = function(projectId, fn) {
139154
if (fn == null) {
140155
fn = null;

‎src/Models/ProjectRepository.coffee‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class ProjectRepository extends BaseModel
3333
@debug "Projects::addTag()"
3434
@post "projects/#{Utils.parseProjectId params.id}/repository/tags", params, (data) => fn data if fn
3535

36+
showTag: (projectId, tagName, fn = null) =>
37+
@debug "Projects::showTag()"
38+
@get "projects/#{Utils.parseProjectId projectId}/repository/tags/#{encodeURI tagName}", (data) => fn data if fn
39+
3640
listTags: (projectId, fn = null) =>
3741
@debug "Projects::listTags()"
3842
@get "projects/#{Utils.parseProjectId projectId}/repository/tags", (data) => fn data if fn

0 commit comments

Comments
 (0)