@@ -22,7 +22,7 @@ module.exports = Repository;
22
22
23
23
/**
24
24
* Get a list of repository branches from a project, sorted by name alphabetically.
25
- *
25
+ *
26
26
* @param {Object } params
27
27
* - {String} id The ID of a project
28
28
* @param {Function } callback
@@ -33,10 +33,10 @@ Repository.prototype.getBranches = function (params, callback) {
33
33
} ;
34
34
35
35
/**
36
- * Protects a single project repository branch.
37
- * This is an idempotent function, protecting an already protected repository branch
36
+ * Protects a single project repository branch.
37
+ * This is an idempotent function, protecting an already protected repository branch
38
38
* still returns a 200 Ok status code.
39
- *
39
+ *
40
40
* @param {Object } params
41
41
* - {String} id The ID of a project
42
42
* - {String} branch The name of the branch
@@ -48,10 +48,10 @@ Repository.prototype.protectBranch = function (params, callback) {
48
48
} ;
49
49
50
50
/**
51
- * Unprotects a single project repository branch.
52
- * This is an idempotent function, unprotecting an already unprotected repository branch
51
+ * Unprotects a single project repository branch.
52
+ * This is an idempotent function, unprotecting an already unprotected repository branch
53
53
* still returns a 200 Ok status code.
54
- *
54
+ *
55
55
* @param {Object } params
56
56
* - {String} id The ID of a project
57
57
* - {String} branch The name of the branch
@@ -64,7 +64,7 @@ Repository.prototype.unprotectBranch = function (params, callback) {
64
64
65
65
/**
66
66
* Get a single project repository branch.
67
- *
67
+ *
68
68
* @param {Object } params
69
69
* - {String} id The ID of a project
70
70
* - {String} branch The name of the branch
@@ -77,7 +77,7 @@ Repository.prototype.getBranch = function (params, callback) {
77
77
78
78
/**
79
79
* Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
80
- *
80
+ *
81
81
* @param {Object } params
82
82
* - {String} id The ID of a project
83
83
* @param {Function } callback
@@ -89,7 +89,7 @@ Repository.prototype.getTags = function (params, callback) {
89
89
90
90
/**
91
91
* Get a list of repository commits in a project.
92
- *
92
+ *
93
93
* @param {Object } params
94
94
* - {String} id The ID of a project
95
95
* - {String} [ref_name] The name of a repository branch or tag or if not given the default branch
@@ -102,7 +102,7 @@ Repository.prototype.getCommits = function (params, callback) {
102
102
103
103
/**
104
104
* Get a list of repository files and directories in a project.
105
- *
105
+ *
106
106
* @param {Object } params
107
107
* - {String} id The ID of a project
108
108
* - {String} [path] The path inside repository, default is '/'. Used to get contend of subdirectories. e.g.: `test`
@@ -116,7 +116,7 @@ Repository.prototype.getTree = function (params, callback) {
116
116
117
117
/**
118
118
* Get the raw file contents for a file.
119
- *
119
+ *
120
120
* @param {Object } params
121
121
* - {String} id The ID of a project
122
122
* - {String} sha The commit or branch name
@@ -128,3 +128,17 @@ Repository.prototype.getBlob = function (params, callback) {
128
128
params . contentType = 'buffer' ;
129
129
this . client . request ( 'get' , this . path + '/:sha/blob' , params , callback ) ;
130
130
} ;
131
+
132
+ /**
133
+ * Get the raw file contents for a blob by blob sha.
134
+ *
135
+ * @param {Object } params
136
+ * - {String} id The ID of a project
137
+ * - {String} sha The blob sha
138
+ * @param {Function } callback
139
+ */
140
+ Repository . prototype . getRawBlob = function ( params , callback ) {
141
+ params . type = 'raw_blobs' ;
142
+ params . contentType = 'buffer' ;
143
+ this . client . request ( 'get' , this . path + '/:sha' , params , callback ) ;
144
+ } ;
0 commit comments