From 9fef844fd9adf0d1a2a68890d5b4d92244f95874 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Mon, 24 Oct 2011 19:06:46 -0700 Subject: [PATCH] use git clean - thanks lundy --- stack.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stack.sh b/stack.sh index e3f8a94..4b73102 100755 --- a/stack.sh +++ b/stack.sh @@ -319,11 +319,10 @@ function git_clone { # set the url to pull from and fetch git remote set-url origin $GIT_REMOTE git fetch origin - # if we don't delete the local content, then our system has pyc files - # from the previous branch leading to breakage (due to the py files - # having older timestamps than our pyc, so python thinks the pyc files - # are correct using them) - sudo rm -rf * + # remove the existing ignored files (like pyc) as they cause breakage + # (due to the py files having older timestamps than our pyc, so python + # thinks the pyc files are correct using them) + sudo git clean -f -d git checkout -f origin/$GIT_BRANCH # a local branch might not exist for $3 git branch -D $GIT_BRANCH || true