Skip to content

Commit

Permalink
Merge pull request #168 from tschaub/depth
Browse files Browse the repository at this point in the history
Clone with depth 1 by default
  • Loading branch information
tschaub authored May 6, 2017
2 parents 5c4a5a1 + 861895c commit afee74d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions bin/gh-pages
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ program
.option('-o, --remote <name>', 'The name of the remote', 'origin')
.option('-m, --message <message>', 'commit message', 'Updates')
.option('-g, --tag <tag>', 'add tag to commit')
.option('-p, --depth <depth>', 'depth for clone', 1)
.option('-t, --dotfiles', 'Include dotfiles')
.option('-a, --add', 'Only add, and never remove existing files.')
.option(
Expand Down
7 changes: 3 additions & 4 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ exports.clone = function clone(repo, dir, branch, options) {
branch,
'--single-branch',
'--origin',
options.remote
options.remote,
'--depth',
options.depth
];
if (options.depth) {
args.push('--depth', options.depth);
}
return spawn(git, args).catch(function(err) {
// try again without banch options
return spawn(git, ['clone', repo, dir, '--origin', options.remote]);
Expand Down
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports.publish = function publish(basePath, config, callback) {
add: false,
git: 'git',
clone: getCacheDir(),
depth: 1,
dotfiles: false,
branch: 'gh-pages',
remote: 'origin',
Expand Down

0 comments on commit afee74d

Please sign in to comment.