Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify that target path for clone repository is a git repository instead... #39

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/whiskey_disk.rb
Expand Up @@ -211,8 +211,8 @@ def safe_branch_checkout(path, my_branch)

def clone_repository(repo, path, my_branch)
enqueue "cd #{parent_path(path)}"
enqueue("if [ -e #{path} ]; then echo 'Repository already cloned to [#{path}]. Skipping.'; " +
"else git clone #{repo} #{tail_path(path)} && #{safe_branch_checkout(path, my_branch)}; fi")
enqueue("if git --git-dir=#{path}/.git status >/dev/null 2>&1 ; then echo 'Repository already cloned to [#{path}]. Skipping.'; " +
"else rm -rf #{path} && git clone #{repo} #{tail_path(path)} && #{safe_branch_checkout(path, my_branch)}; fi")
end

def refresh_checkout(path, repo_branch)
Expand Down