From: Barış Metin Date: Fri, 11 Jun 2010 12:57:40 +0000 (+0200) Subject: properly handle untracked files in git X-Git-Tag: 5.0-rc11~65^2^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=43ea37b601a98d89cc1b42871aa50282f20e32db;p=build.git properly handle untracked files in git --- 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():