Skip to content

Commit

Permalink
Merge pull request #1 from nzoschke/master
Browse files Browse the repository at this point in the history
New feature: repo:reset to entirely blow away repo and cache
  • Loading branch information
lstoll committed Apr 1, 2012
2 parents 642c0ff + 34bc74a commit ccae9a4
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/heroku/command/repo.rb
Expand Up @@ -22,7 +22,7 @@ def purge_cache
tar -zxf ../repo.tgz
rm -rf .cache/*
tar -zcf ../repack.tgz .
curl --upload-file ../repack.tgz '#{repo_put_url}'
curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
exit
EOF
end
Expand All @@ -41,7 +41,7 @@ def gc
tar -zxf ../repo.tgz
git gc --aggressive
tar -zcf ../repack.tgz .
curl --upload-file ../repack.tgz '#{repo_put_url}'
curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
exit
EOF
end
Expand All @@ -54,6 +54,21 @@ def download
system("curl -o #{app}-repo.tgz '#{repo_get_url}'")
end

# repo:reset
#
# Reset the repo and cache
def reset
run <<EOF
set -e
mkdir -p repo_tmp/unpack
cd repo_tmp/unpack
git init --bare .
tar -zcf ../repack.tgz .
curl -o /dev/null --upload-file ../repack.tgz '#{repo_put_url}'
exit
EOF
end

private

def release
Expand Down

0 comments on commit ccae9a4

Please sign in to comment.