"How can there be a treaty for the polytheists with Allah and His Messenger, except for those with whom you made a treaty at the Sacred Mosque?" Meaning: The treaty exists only for those who have not broken it.
"So as long as they are upright with you" regarding the treaty, "be upright with them" regarding it.
"Indeed, Allah loves the righteous."
﴿كَيْفَ يَكُونُ لِلْمُشْرِكِينَ عَهْدٌ عِنْدَ اللَّهِ وَعِنْدَ رَسُولِهِ إِلا الَّذِينَ عاهدتم عِنْد الْمَسْجِد الْحَرَام﴾ أَيْ: لَيْسَ الْعَهْدُ إِلا لِهَؤُلاءِ الَّذِينَ لَمْ يَنْكُثُوا.
﴿فَمَا اسْتَقَامُوا لكم﴾ على الْعَهْد ﴿فاستقيموا لَهُم﴾ عَلَيْهِ.
﴿إِنَّ اللَّهَ يُحِبُّ الْمُتَّقِينَ﴾.