that he found ʿUmar bin Al-Khattab in a group of people and he was swearing by his father. So Messenger of Allah ﷺ called them, saying, "Verily! Allah forbids you to swear by your fathers. If one has to take an oath, he should swear by Allah or otherwise keep quiet." (Using translation from Bukhārī 6108)
رَسُولَ اللهِ ﷺ أَدْرَكَ عُمَرَ بْنَ الْخَطَّابِ وَهُوَ يَسِيرُ فِي رَكْبٍ وَهُوَ يَحْلِفُ بِأَبِيهِ فَقَالَ رَسُولُ اللهِ ﷺ أَلَا إِنَّ اللهَ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ مَنْ كَانَ حَالِفًا فَلْيَحْلِفْ بِاللهِ أَوْ لِيَصْمُتْ