From 43ea37b601a98d89cc1b42871aa50282f20e32db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 11 Jun 2010 14:57:40 +0200 Subject: [PATCH] properly handle untracked files in git --- module-tools.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module-tools.py b/module-tools.py index 246aab3f..64cbb654 100755 --- a/module-tools.py +++ b/module-tools.py @@ -133,6 +133,7 @@ class SvnRepository: @classmethod def checkout(cls, remote, path, options): + Command("rm -rf %s" % path, options).run_silent() Command("svn co %s %s" % (remote, path), options).run_fatal() return SvnRepository(path, options) @@ -167,6 +168,7 @@ class GitRepository: @classmethod def checkout(cls, remote, path, options, depth=1): + Command("rm -rf %s" % path, options).run_silent() Command("git clone --depth %d %s %s" % (depth, remote, path), options).run_fatal() return GitRepository(path, options) @@ -189,11 +191,13 @@ class GitRepository: return self.__run_command_in_repo("git pull") def commit(self, logfile): - self.__run_command_in_repo("git commit -F %s" % logfile) + self.__run_command_in_repo("git add -A") + self.__run_command_in_repo("git commit -F %s" % logfile) self.__run_command_in_repo("git push") def revert(self): - return self.__run_command_in_repo("git --no-pager reset --hard") + self.__run_command_in_repo("git --no-pager reset --hard") + self.__run_command_in_repo("git --no-pager clean -f") def is_clean(self): def check_commit(): -- 2.47.0