Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
Sahih al-Bukhari 4051

Narrated Jabir:

This Verse: "When two of your parties almost Decided to fall away..." was revealed in our connection, i.e. Bani Salama and Bani Haritha and I would not have liked that, if it was not revealed, for Allah said:-- But Allah was their Protector.....(3.122)

حَدَّثَنَا مُحَمَّدُ بْنُ يُوسُفَ، عَنِ ابْنِ عُيَيْنَةَ، عَنْ عَمْرٍو، عَنْ جَابِرٍ ـ رضى الله عنه ـ قَالَ نَزَلَتْ هَذِهِ الآيَةُ فِينَا ‏{‏إِذْ هَمَّتْ طَائِفَتَانِ مِنْكُمْ أَنْ تَفْشَلاَ‏}‏ بَنِي سَلِمَةَ وَبَنِي حَارِثَةَ، وَمَا أُحِبُّ أَنَّهَا لَمْ تَنْزِلْ، وَاللَّهُ يَقُولُ ‏{‏وَاللَّهُ وَلِيُّهُمَا‏}
Reference : Sahih al-Bukhari 4051
In-book reference : Book 64, Hadith 97
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 381
  (deprecated numbering scheme)