function clone (repo, ref) {
	return Observable.create((observer) => {
		const tmpDest = getTmp()

		const completeHandler = () => {
			observer.next(tmpDest)
			observer.complete()
		}
		const errorHandler = (err) => {
			log(`failed to clone repository from ${repo}`)
			observer.error(err)
		}
		const args = ['clone', '-b', ref, repo, tmpDest, '--single-branch']
		log(`cloning git repository from ${repo}`)
		const git = spawnGit(args)
		git.on('close', code => (code ? errorHandler() : completeHandler()))
	})
}
clone a git repository.
@param {String} repo - git repository to clone.
@param {String} ref - git reference to checkout.
@return {Observable} - observable sequence that will be completed once
the git repository has been cloned.