
227 Ga. 177 (1971)
179 S.E.2d 518
PERKINS
v.
PERKINS; and vice versa.
26162, 26163.
Supreme Court of Georgia.
Submitted November 9, 1970.
Decided January 7, 1971.
Rehearing Denied January 21, 1971.
*178 McDonald, Dupree & Channell, Hylton B. Dupree, Jr., Duard R. McDonald, for appellant.
Berl T. Tate, Charles F. Reeves, for appellee.
MOBLEY, Presiding Justice.
This is a divorce and custody case brought by the husband, charging his wife with adulterous conduct, and by amendment alleging "the statutory ground of mental cruelty," and praying for a divorce and custody of their three minor children.
The trial judge, hearing the case without a jury, entered judgment granting the husband a divorce and custody of the children, with visitation rights in the wife. The appeal by the wife is from that judgment. The enumeration of errors contains twelve grounds, the first six of which allege errors committed, and grounds 7 through 12 assign error on the overruling of the motion for new trial on the same grounds as those set out in 1 through 6. Thus a ruling on the first six grounds determines the remainder of the grounds.
1. Enumeration of error 1 alleges that the husband could not properly have been granted a divorce on the ground of the wife's adultery. Appellee agrees with this. The husband condoned the adultery by living with her thereafter. The court, trying the case without a jury, admitted evidence of the adulterous conduct of the wife on the question of custody of the children only. We would assume that the court confined its consideration of that evidence to the custody question.
2. Enumeration of error 2 alleges that the husband was not entitled to a divorce on the ground of cruel treatment, as set out in Code Ann. § 30-102 (10).
The husband testified that he caught his wife kissing a man (Woody) while sitting in his truck at a shopping center, and that shortly thereafter he separated from her. He testified that: Previous to the kissing episode he had become suspicious of his wife's fidelity to him and that she was seeing another man. She had told him that she loved no other man, and that she was not going to meet any other man, but was going to stay at home and look after *179 the children. Based upon these promises, he dismissed his previous divorce petition. Shortly thereafter she started again; she would be gone from home until 2 or 3 in the morning. She went back to work, although he told her he would pay her doctors' bills, which she claimed caused her to go back to work. She went to work at Woolworth's in Atlanta, and at first she got home about 6:30 to 7 p. m., and then it began to be 8 or 8:30, which required him to close his filling station and go get one of the children who practiced football after school. She would excuse her lateness on a flat tire, that she had run out of gas, or the store stayed open late. He had been getting telephone calls at the station about 11 or 11:15 a. m. So, on September 16, he parked his car at Woolworth's waited until his wife came out of the store and got in the station wagon. He followed her, and she drove about 1 1/4 miles to another shopping center. She drove all through the shopping center as if looking for someone; she stopped, used a pay telephone, talked for about 30 minutes and then went back to work. He went back to the pay telephone, called her at work, told her he would come by and buy her lunch. She said she had just eaten a sandwich at the store. He asked her why she did not go to a restaurant and she said, "Well, I didn't want to go anywhere today." He went to the shopping center again on the 18th, and saw his automobile there. He parked and in a few minutes W. B. Woody drove up. His wife was sitting over against Woody, and they parked. Woody had his arm around his wife and she was kissing him. He got out of his truck and went to them and told Woody what he thought of him, his supposed friend for 3 or 4 years, all the telephone calls he had made to his wife, all the times they were talking when he picked up the telephone. Woody admitted that he had been seeing her for a year.
This evidence of cruel treatment is sufficient to support the verdict. Enumeration of error 2 is without merit.
3. Enumeration of error 3 alleges that the court erred in admitting the deposition of Dr. Virgil Lee Curry over the objection that it was partially hearsay, and that the remainder was irrelevant and immaterial to any issue pending before the court. This testimony was admitted solely on the question of custody of the children.
*180 Dr. Curry, a urologist, testified that he examined the husband on March 3, 1969. He gave his opinion that the husband had been sterile from approximately two weeks following his sterilization operation in 1960. Dr. Curry based this opinion on his examination of the husband, and on the history he had obtained from the husband that he underwent a sterilization operation in 1960.
The significance of this testimony was that evidence was introduced that the wife had a miscarriage in February, 1969.
We think the court erred in admitting the opinion evidence of Dr. Curry, that the husband was sterile from the date of an operation in 1960, since this opinion was predicated on the history given to him by the husband. This State does not recognize as an exception to the hearsay rule the history given by a patient to an examining physician. Atlanta K. & N. R. Co. v. Gardner, 122 Ga. 82 (11) (49 SE 818); Paulk v. Thomas, 115 Ga. App. 436 (3) (154 SE2d 872).
In the present case the error of admitting the hearsay testimony is compounded by the fact that it is against the public policy of this State to allow a husband to testify to any fact tending to show that his wife has committed adultery. Code § 38-1606, as amended; Bishop v. Bishop, 124 Ga. 293 (3) (52 SE 743). The fact that the husband was allowed to testify in regard to this operation would not render the error harmless, since his testimony in regard to a fact tending to show the adultery of his wife was incompetent, even without objection. Peacon v. Peacon, 197 Ga. 748 (2) (30 SE2d 640).
The error in admitting the hearsay testimony of Dr. Curry on the issue of the custody of the children renders the custody award illegal, and we reverse this part of the judgment.
4. Enumeration of error 4 alleges that the judgment and decree of the court is contrary to law. Enumeration of error 5 alleges that the judgment and decree of the court was illegal, and the court therefore had no legal right to determine custody of the minor children.
In previous divisions we have held that the evidence supported the finding in favor of the husband's action for divorce, but that the finding in regard to the custody of the children was erroneous, and it is therefore unnecessary to consider enumerations of error 4 and 5.
5. The sixth enumeration of error alleges that the court erred in *181 allowing the husband to amend his petition after all the evidence was in, alleging cruel treatment as a ground of divorce, where adultery had been alleged and the case was tried on that ground. It is contended that this deprived the wife of her right to demand a more definite statement as provided in Code § 30-105, as amended (Ga. L. 1967, pp. 761-762).
"When issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been raised in the pleadings. Such amendment of the pleadings as may be necessary to cause them to conform to the evidence and to raise these issues may be made upon motion of any party at any time, even after judgment; but failure so to amend does not affect the result of the trial of these issues. If evidence is objected to at the trial on the ground that it is not within the issues made by the pleadings, the court may allow the pleadings to be amended and shall do so freely when the presentation of the merits of the action will be subserved thereby and the objecting party fails to satisfy the court that the admission of such evidence would prejudice him in maintaining his action or defense upon the merits. The court may grant a continuance to enable the objecting party to meet such evidence." Code Ann. § 81A-115 (b) (Ga. L. 1966, pp. 609, 627).
The husband produced evidence of cruel treatment and obviously, applying the quoted Code section, the amendment alleging cruel treatment as a ground for divorce was in order. This enumeration of error is without merit.
7. The enumeration of errors on the cross appeal was not filed within the time required by the rules of this court, and the cross appeal is dismissed.
Judgment affirmed in part; reversed in part on the main appeal. Cross appeal dismissed. All the Justices concur.

ON MOTION FOR REHEARING
In the motion for rehearing of the appellee (the husband) it is strongly urged that a judgment granting custody of minor children should not be reversed merely because hearsay evidence was admitted. It is further urged that the trial judge has a broad discretion in determining the right of custody as between parents, *182 which should not be controlled unless the facts and circumstances show an abuse of it. Both of these contentions are abstractly correct, but the facts of this particular case show, unmistakably, that the custody award was based, at least in part, on incompetent evidence.
The husband brought his divorce action originally on the ground of adultery, but concedes that he could not prove his case on that ground because there was a condonation of the alleged adultery. The trial judge allowed evidence tending to show the wife's adultery, but only on the issue of the custody of the minor children. In this connection he allowed hearsay statements of the husband, made to a physician, to be admitted on the issue of custody, over the objection that it was hearsay. This was not inconsequential testimony, but may have been the testimony on which the award of custody was made to the husband.
In Gray v. Gray, 226 Ga. 767 (177 SE2d 575), cited in the motion for rehearing, this court held: "The trial judge stated that he would not consider inadmissible testimony, and in the absence of any statement in his judgment to the contrary, we must assume that he selected the legal testimony from that which was incompetent." In the Gray case we were reviewing a temporary order. The present case decides the permanent custody of minor children. We can not make the assumption in this case that the trial judge did not consider the incompetent evidence, since he made a specific ruling that the evidence was admissible as a patient's history to his physician, and we must assume that he considered this incompetent evidence in making the award of custody.
The discretion vested in the trial judge to award the custody of minor children must be based on competent evidence. The evidence in the present case did not demand a finding that the husband should have the custody of the children, and the consideration of the incompetent evidence was not harmless error.
Judgment adhered to on motions for rehearing. All the Justices concur.
