#190: detecting whether we're inside a git repo should not recurse.

This commit is contained in:
Andr Rodrigues 2012-06-28 13:05:11 -07:00
Родитель bf4d4d3c77
Коммит 3777cb0912
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -1,4 +1,4 @@
/*** Generated by streamline 0.2.5 - DO NOT EDIT ***/
/*** Generated by streamline 0.3.6 (callbacks) - DO NOT EDIT ***/
var __rt=require('streamline/lib/callbacks/runtime').runtime(__filename),__func=__rt.__func,__cb=__rt.__cb,__tryCatch=__rt.__tryCatch,__propagate=__rt.__propagate,__trap=__rt.__trap,__future=__rt.__future,__setEF=__rt.__setEF,__g=__rt.__g;
/* 1 */ var common = require("../common");
/* 17 */ var fs = require("fs");
@ -226,11 +226,11 @@ var __rt=require('streamline/lib/callbacks/runtime').runtime(__filename),__func=
return (function ___(__then) {
(function ___(_) {
__tryCatch(_, function __$determineIfCurrentDirectoryIsGitWorkingTree() {
/* 209 */ return exec("git rev-parse --is-inside-work-tree", __cb(_, __frame, 4, 37, function ___(__0, __1) {
/* 209 */ return exec("git rev-parse --git-dir", __cb(_, __frame, 4, 37, function ___(__0, __1) {
isInsideWorkTree = __1;
/* 210 */ lines = (isInsideWorkTree.stdout + isInsideWorkTree.stderr);
/* 211 */ context.flags.isGitWorkingTree = lines.split("\n").some(function(line) {
/* 212 */ return (line === "true");
/* 212 */ return (line === ".git");
});
__then();
}, true));

Просмотреть файл

@ -206,10 +206,10 @@ exports.init = function (cli) {
log.silly('determineIfCurrentDirectoryIsGitWorkingTree');
try {
var isInsideWorkTree = exec('git rev-parse --is-inside-work-tree', _);
var isInsideWorkTree = exec('git rev-parse --git-dir', _);
var lines = isInsideWorkTree.stdout + isInsideWorkTree.stderr;
context.flags.isGitWorkingTree = lines.split('\n').some(function (line) {
return line === 'true';
return line === '.git';
});
} catch (err) {
context.flags.isGitWorkingTree = false;