Detect with git-p4 submit --direct when there are no changes in the working directory
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Simon Hausmann committed
May 21, 2007 at 10:08 UTC
cbf5efa61a30d6454f5739cee3498f98a01210da
1 file changed
+3
contrib/fast-import/git-p4
+3
@@ -386,6 +386,9 @@ class P4Submit(Command):
386
387
if self.directSubmit:
388
self.diffStatus = mypopen("git diff -r --name-status HEAD").readlines()
389
+ if len(self.diffStatus) == 0:
390
+ print "No changes in working directory to submit."
391
+ return True
392
patch = mypopen("git diff -p --binary --diff-filter=ACMRTUXB HEAD").read()
393
self.diffFile = gitdir + "/p4-git-diff"
394
f = open(self.diffFile, "wb")