diff --git a/compiler/main.lisp b/compiler/main.lisp
index 7bfce70b491111804604ebfb8b18298a822af29b..58af0435decd4958467b5566143f5a01915dc785 100644
--- a/compiler/main.lisp
+++ b/compiler/main.lisp
@@ -1127,11 +1127,13 @@ in the user USER-INFO slot of STREAM-SOURCE-LOCATIONs.")
 	       (setf (default-directory) cwd))))
 	 (generate-comment (file-info)
 	   (let* ((name (pathname (source-info-stream file-info)))
-		  (proc (run-git name)))
-	     (if (and proc (zerop (process-exit-code proc)))
+		  (proc (run-git name))
+		  comment)
+	     (if (and proc (zerop (process-exit-code proc))
+		      (setf comment (read-line (process-output proc) nil nil)))
 		 (format nil "$Header: ~A ~A $"
 			 (enough-namestring name)
-			 (read-line (process-output proc)))
+			 comment)
 		 (second form)))))
       (cond ((file-info-comment file)
 	     (compiler-warning _N"Ignoring extra file comment:~%  ~S." form))