lib/gitsync.js
function(cb) {
            var lockFile = path.join(repoDir, '.git', 'index.lock');
            path.exists(lockFile, function(exists) {
                if (exists) {
                    fs.unlink(lockFile, function(err) {
                        if (err) {
                            log.warn('removing file ' + lockFile + ' failed with:', err);
                        }
                        else {
                            log.info('removed lock file: ' + lockFile);
                        }
                        cb(err, {removelock: 'remove git lock ' + lockFile + ', result ' + err});
                    });
                    return;
                }
                log.log('There is no lock file left, which is a good thing');
                cb(null, {removelock: 'no lock was present'});
            });
        }
function(cb) {
            var lockFile = path.join(repoDir, '.git', 'index.lock');
            path.exists(lockFile, function(exists) {
                if (exists) {
                    fs.unlink(lockFile, function(err) {
                        if (err) {
                            log.warn('removing file ' + lockFile + ' failed with:', err);
                        }
                        else {
                            log.info('removed lock file: ' + lockFile);
                        }
                        cb(err, {removelock: 'remove git lock ' + lockFile + ', result ' + err});
                    });
                    return;
                }
                log.log('There is no lock file left, which is a good thing');
                cb(null, {removelock: 'no lock was present'});
            });
        }
function ( cb ) { var lockFile = path . join ( repoDir , '.git' , 'index.lock' ) ; path . exists ( lockFile , function ( exists ) { if ( exists ) { fs . unlink ( lockFile , function ( err ) { if ( err ) { log . warn ( 'removing file ' + lockFile + ' failed with:' , err ) ; } else { log . info ( 'removed lock file: ' + lockFile ) ; } cb ( err , { removelock : 'remove git lock ' + lockFile + ', result ' + err } ) ; } ) ; return ; } log . log ( 'There is no lock file left, which is a good thing' ) ; cb ( null , { removelock : 'no lock was present' } ) ; } ) ; }
Remove git lock file to recover if git operation was aborted during previous run.
Remove git lock file to recover if git operation was aborted during previous run .