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

Commit b747593

Browse files
committed
git: revert 44da664
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.
1 parent a713b9c commit b747593

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

lib/cache/maybe-github.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
var assert = require("assert")
2-
, log = require("npmlog")
3-
, addRemoteGit = require("./add-remote-git.js")
4-
, hosted = require("hosted-git-info")
1+
var assert = require('assert')
2+
3+
var hosted = require('hosted-git-info')
4+
var log = require('npmlog')
5+
6+
var addRemoteGit = require('./add-remote-git.js')
57

68
module.exports = function maybeGithub (p, cb) {
7-
assert(typeof p === "string", "must pass package name")
8-
assert(typeof cb === "function", "must pass callback")
9+
assert(typeof p === 'string', 'must pass package name')
10+
assert(typeof cb === 'function', 'must pass callback')
911

1012
var parsed = hosted.fromUrl(p)
11-
log.info("maybeGithub", "Attempting %s from %s", p, parsed.git())
13+
log.info('maybeGithub', 'Attempting %s from %s', p, parsed.git())
1214

1315
return addRemoteGit(parsed.git(), true, function (er, data) {
1416
if (er) {
15-
log.info("maybeGithub", "Couldn't clone %s", parsed.git())
16-
log.info("maybeGithub", "Now attempting %s from %s", p, parsed.sshurl())
17+
log.info('maybeGithub', "Couldn't clone %s", parsed.git())
18+
log.info('maybeGithub', 'Now attempting %s from %s', p, parsed.sshurl())
1719

1820
return addRemoteGit(parsed.sshurl(), false, function (er, data) {
1921
if (er) return cb(er)

lib/utils/git.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ function prefixGitArgs () {
2020
function execGit (args, options, cb) {
2121
log.info('git', args)
2222
var fullArgs = prefixGitArgs().concat(args || [])
23-
return exec(git, fullArgs, options, function (err) {
24-
if (err) log.error('git', fullArgs.join(' '))
25-
26-
cb.apply(null, arguments)
27-
})
23+
return exec(git, fullArgs, options, cb)
2824
}
2925

3026
function spawnGit (args, options) {

0 commit comments

Comments
 (0)