Skip to content

Commit f8aba26

Browse files
authored
fixes type to be the same as the event names (#32)
* fixes type to be the same as the event names * updates changelog
1 parent 18593d2 commit f8aba26

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.4.1 (12/04/2017)
2+
3+
- fixes type to be the same as the event names
4+
15
# 0.4.0 (12/03/2017)
26

37
- [BREAKING] changes the interface for authentication to make it more flexible

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> 🎡 A configurable git server written in Node.js
44
5-
>> there be 🐲 here! The API's and functionality are still be cemented, anything before a 1.0.0 release will be subject to change.
5+
>> there be 🐲 here! The API's and functionality are still be cemented, anything before a 1.0.0 release will be subject to change.
66
77
[![Npm Version](https://img.shields.io/npm/v/node-git-server.svg)](https://www.npmjs.com/package/node-git-server)
88
[![Build Status](https://travis-ci.org/gabrielcsapo/node-git-server.svg?branch=master)](https://travis-ci.org/gabrielcsapo/node-git-server)
@@ -25,7 +25,7 @@ const Server = require('node-git-server');
2525
const repos = new Server(path.resolve(__dirname, 'tmp'), {
2626
autoCreate: true,
2727
authenticate: (type, repo, user, next) => {
28-
if(type == 'upload') {
28+
if(type == 'push') {
2929
user((username, password) => {
3030
console.log(username, password);
3131
next();

example/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const repos = new Server(path.normalize(path.resolve(__dirname, 'tmp')), {
88
autoCreate: true,
99
authenticate: (type, repo, user, next) => {
1010
console.log(type, repo); // eslint-disable-line
11-
if(type == 'upload') {
11+
if(type == 'push') {
1212
user((username, password) => {
1313
console.log(username, password); // eslint-disable-line
1414
next();

lib/git.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,17 @@ class Git extends EventEmitter {
239239
/**
240240
* returns the typeof service being process
241241
* @method getType
242-
* @param {Service} service - the service type
242+
* @param {String} service - the service type
243243
* @return {String} - will respond with either upload or download
244244
*/
245245
getType(service) {
246246
switch(service) {
247247
case 'upload-pack':
248+
return 'fetch';
248249
case 'receive-pack':
249-
return 'upload';
250+
return 'push';
250251
default:
251-
return 'download';
252+
return 'unknown';
252253
}
253254
}
254255
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-git-server",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "🎡 A configurable git server written in Node.js",
55
"author": "Gabriel J. Csapo <[email protected]>",
66
"contributors": [

0 commit comments

Comments
 (0)