From: Simon Hausmann Date: Mon, 21 May 2007 08:08:11 +0000 (+0200) Subject: Detect with git-p4 submit --direct when there are no changes in the working directory X-Git-Tag: v1.5.3-rc0~65^2^2~79 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cbf5efa61a30d6454f5739cee3498f98a01210da;p=git.git Detect with git-p4 submit --direct when there are no changes in the working directory Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 35a513fcb..f08ee6da4 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -386,6 +386,9 @@ class P4Submit(Command): if self.directSubmit: self.diffStatus = mypopen("git diff -r --name-status HEAD").readlines() + if len(self.diffStatus) == 0: + print "No changes in working directory to submit." + return True patch = mypopen("git diff -p --binary --diff-filter=ACMRTUXB HEAD").read() self.diffFile = gitdir + "/p4-git-diff" f = open(self.diffFile, "wb")