Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
git: revert 44da664
Browse files Browse the repository at this point in the history
It turns out that git commands do now log their output
appropriately, and this change was causing misleading output when using
`maybeGithub`, which was exposed by
89ce829, which fixed #7630. npm's git
functionality is maybe a little overcomplicated at this point.
  • Loading branch information
othiym23 committed Apr 2, 2015
1 parent a713b9c commit b747593
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
20 changes: 11 additions & 9 deletions lib/cache/maybe-github.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
var assert = require("assert")
, log = require("npmlog")
, addRemoteGit = require("./add-remote-git.js")
, hosted = require("hosted-git-info")
var assert = require('assert')

var hosted = require('hosted-git-info')
var log = require('npmlog')

var addRemoteGit = require('./add-remote-git.js')

module.exports = function maybeGithub (p, cb) {
assert(typeof p === "string", "must pass package name")
assert(typeof cb === "function", "must pass callback")
assert(typeof p === 'string', 'must pass package name')
assert(typeof cb === 'function', 'must pass callback')

var parsed = hosted.fromUrl(p)
log.info("maybeGithub", "Attempting %s from %s", p, parsed.git())
log.info('maybeGithub', 'Attempting %s from %s', p, parsed.git())

return addRemoteGit(parsed.git(), true, function (er, data) {
if (er) {
log.info("maybeGithub", "Couldn't clone %s", parsed.git())
log.info("maybeGithub", "Now attempting %s from %s", p, parsed.sshurl())
log.info('maybeGithub', "Couldn't clone %s", parsed.git())
log.info('maybeGithub', 'Now attempting %s from %s', p, parsed.sshurl())

return addRemoteGit(parsed.sshurl(), false, function (er, data) {
if (er) return cb(er)
Expand Down
6 changes: 1 addition & 5 deletions lib/utils/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ function prefixGitArgs () {
function execGit (args, options, cb) {
log.info('git', args)
var fullArgs = prefixGitArgs().concat(args || [])
return exec(git, fullArgs, options, function (err) {
if (err) log.error('git', fullArgs.join(' '))

cb.apply(null, arguments)
})
return exec(git, fullArgs, options, cb)
}

function spawnGit (args, options) {
Expand Down

0 comments on commit b747593

Please sign in to comment.