Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/gitsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GitSync.prototype.align = function(repoDir, branch, callback) {
// Remove git lock file to recover if git operation was aborted during previous run.
function(cb) {
var lockFile = path.join(repoDir, '.git', 'index.lock');
path.exists(lockFile, function(exists) {
fs.exists(lockFile, function(exists) {
if (exists) {
fs.unlink(lockFile, function(err) {
if (err) {
Expand All @@ -63,7 +63,7 @@ GitSync.prototype.align = function(repoDir, branch, callback) {
if (err) {
log.warn('git status failed on ' + repoDir + ":", err.msg);
var indexFile = path.join(repoDir, '.git', 'index');
path.exists(indexFile, function(exists) {
fs.exists(indexFile, function(exists) {
if (exists) {
fs.unlink(indexFile, function(err) {
if (err) {
Expand Down Expand Up @@ -181,7 +181,7 @@ GitSync.prototype.sync = function(url, branch, dir, callback) {

// check if we already have a directory by that name
// if we do, assume it is already cloned and just pull.
path.exists(dir, function(exists) {
fs.exists(dir, function(exists) {

if (exists) {

Expand Down Expand Up @@ -221,14 +221,14 @@ GitSync.prototype.clonebranch = function(url, branch, dir, callback) {
var self = this;
// make sure root directory exists
var root = path.dirname(dir);
path.exists(root, function(exists) {
fs.exists(root, function(exists) {
if (!exists) {
log.error('root directory ' + root + ' does not exist');
callback("parent of dir must exists (" + root + ")");
return;
}

path.exists(dir, function(exists) {
fs.exists(dir, function(exists) {
// If directory for branch already exists, need to remove it
if (exists) {
rimraf(dir, function(err) {
Expand Down Expand Up @@ -601,7 +601,7 @@ function _defaultCallback(err) {
function _ensureExists(dir, callback) {
dir = path.resolve(dir); // make full path

path.exists(dir, function(exists) {
fs.exists(dir, function(exists) {
if (!exists) {
// ensure that the parent dir exists
_ensureExists(path.dirname(dir), function(err) {
Expand Down