Permalink
Browse files

add cwd and repo to info and head duplex event objects

  • Loading branch information...
1 parent d7031a8 commit 07252a88f87b4e60233e067d66672fd3218a3b8d @substack committed Sep 23, 2012
Showing with 6 additions and 0 deletions.
  1. +4 −0 lib/handle.js
  2. +2 −0 lib/info.js
View
@@ -9,6 +9,7 @@ var services = [ 'upload-pack', 'receive-pack' ]
var createAction = require('./service');
var noCache = require('./no_cache');
var infoResponse = require('./info');
+var httpDuplex = require('http-duplex');
module.exports = function (req, res) {
var self = this;
@@ -74,6 +75,9 @@ handlers.push(function (req, res) {
var anyListeners = self.listeners('head').length > 0;
var dup = httpDuplex(req, res);
dup.exists = ex;
+ dup.repo = repo;
+ dup.cwd = path.join(self.repoDir, repo)
+
dup.accept = function () { dup.emit('accept') };
dup.reject = function (code) { dup.emit('reject', code) };
View
@@ -8,6 +8,8 @@ var onexit = require('./onexit');
module.exports = function (opts, req, res) {
var self = opts.repos;
var dup = httpDuplex(req, res);
+ dup.cwd = path.join(self.repoDir, opts.repo)
+ dup.repo = opts.repo;
dup.accept = function () { dup.emit('accept') };
dup.reject = function (code) { dup.emit('reject', code) };

0 comments on commit 07252a8

Please sign in to comment.