
136 Cal.App.3d 472 (1982)
186 Cal. Rptr. 269
In re DONALD LEE ANDERSON on Habeas Corpus.
Docket No. 6309.
Court of Appeals of California, Fifth District.
September 17, 1982.
*473 COUNSEL
Donald Lee Anderson, in pro. per., and Randy Montesano, under appointment by the Court of Appeal, for Petitioner.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, Arnold O. Overoye, Assistant Attorney General, Joel Carey and Robert D. Marshall, Deputy Attorneys General, for Respondent.
OPINION
THE COURT.[*]
On April 1, 1982, petitioner filed in the California Supreme Court a petition for writ of habeas corpus seeking a total of 148 days of presentence credit.
On April 22, 1982, the Supreme Court ordered the Director of Corrections to show cause before this court "... why petitioner should not be awarded credit pursuant to Penal Code sections 2900.5 and 4019, for the period of custody between his arrest and sentence in the Stanislaus County Superior Court in People v. Donald Lee Anderson, Crim. Case No. 160560, in light of In re Rojas, 23 Cal.3d 152, 157, and In re Bentley, 43 Cal. App.3d 988."
After the filing of respondent's return and additional briefing, the parties waived the oral argument which had been set for August 16, 1982.
*474 Petitioner was arrested for a violation of Penal Code section 245, subdivision (a), on May 31, 1979. Because of this assault, petitioner's parole on a prior conviction was revoked on July 19, 1979. The trial court sentenced petitioner on September 6, 1979, to four years in state prison upon the assault charge in Stanislaus County Superior Court action No. 160560.
(1) Petitioner contends that the trial court erred by not giving him credit on his sentence for assault for the 99 days he spent in presentence confinement and for 49 days of conduct credits he should have earned for his presentence custody.
Penal Code section 2900.5 authorizes presentence credit "only where the custody to be credited is attributable to proceedings related to the same conduct for which the defendant has been convicted." In re Hodges (1979) 89 Cal. App.3d 221 [152 Cal. Rptr. 394], phrases the test as follows: "petitioner would be entitled to presentence custody credit if but only if the conduct for which he is ultimately convicted was the cause of that confinement." (Id., at p. 226.)
Petitioner's confinement between May 31, 1979, and the revocation of his parole was caused by his arrest upon the assault charge. Petitioner would be entitled to credit on his sentence for assault for this custody irrespective of whether a parole hold had been filed upon his initital arrest. (People v. Simpson (1981) 120 Cal. App.3d 772 [174 Cal. Rptr. 790]; People v. Brown (1980) 107 Cal. App.3d 858 [166 Cal. Rptr. 144].)
The issue of whether petitioner is entitled to custody credits for the time between his parole revocation and his sentence for assault must be resolved in petitioner's favor in light of In re Rojas (1979) 23 Cal.3d 152 [151 Cal. Rptr. 649, 588 P.2d 789], and In re Bentley (1974) 43 Cal. App.3d 988 [118 Cal. Rptr. 452]. The relevant facts in Bentley are identical to the circumstances of this case. In Bentley the defendant was arrested on a new offense while on parole for a prior conviction. Prior to his sentencing on the new offense, the defendant's parole was revoked. The court in Bentley awarded the defendant custody credit on his sentence on the new offense for the entire period of presentence confinement, including the period between his parole revocation and sentencing. The Supreme Court in Rojas stated that, "[a] literal interpretation of section 2900.5 would have allowed Bentley his credit under those facts." (Rojas, supra, 23 Cal.3d at p. 157.) Rojas is therefore Supreme Court precedent for awarding petitioner credit for the entire time he was in custody from the date of his arrest to the date of his *475 sentence on the assault charge. (People v. Simpson (1981) 120 Cal. App.3d 772, 776-777 [174 Cal. Rptr. 790]; People v. Penner (1980) 111 Cal. App.3d 168, 170-171 [168 Cal. Rptr. 431].)
Respondent's argument that other language in In re Rojas, supra, compels a different result is meritless. Rojas does state that "a defendant is not to be given credit for the time spent in custody if during the same period he is already serving a term of incarceration." (In re Rojas, supra, 23 Cal.3d 155-156.) Under the facts of Rojas this quotation is correct because the prior "term of incarceration" was due solely to an offense which was completely separate and independent from the second offense upon which the defendant sought custody credits. Thus the defendant would have been incarcerated during the period he sought custody credits irrespective of the second offense. Rojas explains this rationale as follows: "There is no reason in law or logic to extend the protection intended to be afforded one merely charged with a crime to one already incarcerated and serving his sentence for a first offense who is then charged with a second crime. As to the latter individual the deprivation of liberty for which he seeks credit cannot be attributed to the second offense. Section 2900.5 does not authorize credit where the pending proceeding has no effect whatever upon a defendant's liberty." (In re Rojas, supra, 23 Cal.3d at p. 156 (italics added).)
When the above quoted language is read in context with the Rojas approval of In re Bentley, supra, 43 Cal. App.3d 988, it appears that the crucial test is not whether a defendant is serving a sentence during the time he seeks credit for a second offense. Instead, Rojas requires that an inquiry be made into whether the second offense was the cause of the sentence being served. To hold otherwise would require a conclusion that the Supreme Court in Rojas was in error in approving the result in Bentley. This court declines to draw such a conclusion.
This court rejects respondent's contention that this action should be remanded to allow the trial court to determine whether the sole reason for the revocation of petitioner's parole was his arrest for assault. (Cf. People v. Luna (1982) 130 Cal. App.3d 550 [181 Cal. Rptr. 833].) If there is no conflict as to material facts, this court may rule upon the petition in this action without the necessity of an evidentiary hearing. (In re Lawler (1979) 23 Cal.3d 190 [150 Cal. Rptr. 833, 588 P.2d 1257].) The petition in this action avers that "The sole reasons for petitioner's deprivation of liberty including his parole revocation of July 19, 1979 was and is the criminal activity described in information 160560." Respondent has not contested this averment. This court concludes that petitioner's parole revocation was based solely upon the assault.
*476 Petitioner is entitled to custody credit of 99 days in Stanislaus County Superior Court action No. 160560 pursuant to Penal Code section 2900.5.
Petitioner is also entitled to an additional 49 days of good-time/work-time credits for his presentence custody pursuant to Penal Code section 4019. (People v. Sage (1980) 26 Cal.3d 498 [165 Cal. Rptr. 280, 611 P.2d 874]; In re Allen (1980) 105 Cal. App.3d 310, 315 [164 Cal. Rptr. 319].)
Let a writ of habeas corpus issue directing the Stanislaus County Superior Court to file an amended abstract of judgment in Stanislaus County Superior Court action No. 160560 crediting petitioner Donald Lee Anderson with presentence custody credit of 99 days and presentence conduct credits of 49 days for a total of 148 days.
Let a writ of habeas corpus issue directing the Director of Corrections to credit petitioner Donald Lee Anderson with presentence custody credits of 99 days and presentence conduct credits of 49 days for a total of 148 days either upon his term of incarceration served pursuant to his conviction in Stanislaus County Superior Court action No. 160560 or upon his term of parole served pursuant to said conviction insofar as said credits exceed the remaining term of incarceration served upon said conviction. (Cf. In re Sosa (1980) 102 Cal. App.3d 1002 [162 Cal. Rptr. 646].)
NOTES
[*]   Before Zenovich, Acting P.J., Andreen, J., and Hammer, J.[]

[] Assigned by the Chairperson of the Judicial Council.
