From ae59e51cf932523c4b286a80805179da60de3902 Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Wed, 23 May 2012 13:23:32 +0000 Subject: [PATCH] let's ignore failures while resetting git clone (thanks holger!) --- debian_build.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/debian_build.py b/debian_build.py index 0fb93f9..bddef52 100755 --- a/debian_build.py +++ b/debian_build.py @@ -255,22 +255,23 @@ if __name__ == '__main__': # reset local repository first localname = GIT_BRANCH_NAME remotename = os.path.join('origin', GIT_BRANCH_NAME) - try: - logger.info('Reset and clean repository.') - gitcmd = git.Git('.') - logger.debug( - 'git reset --hard HEAD:\n%s' - %(gitcmd.reset('--hard','HEAD')) - ) - logger.debug( - 'git clean -fdx:\n%s' - %(gitcmd.clean('-fdx')) - ) - logger.debug( - 'git branch -D %s\n%s' - %(localname,gitcmd.branch('-D','%s' %(localname))) - ) + logger.info('Reset and clean repository.') + gitcmd = git.Git('.') + logger.debug( + 'git reset --hard HEAD:\n%s' + %(gitcmd.reset('--hard','HEAD')) + ) + logger.debug( + 'git clean -fdx:\n%s' + %(gitcmd.clean('-fdx')) + ) + logger.debug( + 'git branch -D %s\n%s' + %(localname,gitcmd.branch('-D','%s' %(localname))) + ) + + try: logger.info('Checkout branch %s.' %(remotename)) logger.debug( 'git checkout -b %s %s:\n%s' @@ -281,7 +282,7 @@ if __name__ == '__main__': ) ) except Exception, exception: - raise Exception('Failure while managing Git clone:\n%s' %(exception)) + raise Exception('Failure while checking out Git clone:\n%s' %(exception)) else: logger.debug('Status is now:\n%s' %( gitcmd.status() )) -- 2.39.5