]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: don't run gofmt with an empty file list
authorRuss Cox <rsc@golang.org>
Thu, 15 Jul 2010 23:43:06 +0000 (16:43 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 15 Jul 2010 23:43:06 +0000 (16:43 -0700)
R=gri
CC=golang-dev
https://golang.org/cl/1678054

lib/codereview/codereview.py

index 750ae871cad379f83ed447f8ee62439548fcd754..4aeff90678b8abd6773d38ceb0f6bc8de98ce96d 100644 (file)
@@ -694,6 +694,8 @@ def CheckGofmt(ui, repo, files, just_warn=False):
        cwd = os.getcwd()
        files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
        files = [f for f in files if os.access(f, 0)]
+       if not files:
+               return
        try:
                cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
                cmd.stdin.close()