From e65d532d758bcaa4e24c9b144fb3596afcaac5c0 Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov@tarantool.org>
Date: Tue, 25 Jul 2023 10:33:10 +0300
Subject: [PATCH] git: add diff=cpp attribute for C/C++ source files

This improves diff hunk name detection. Needed for checkpatch to
correctly detect if patched code belongs to a function.

NO_DOC=git
NO_TEST=git
NO_CHANGELOG=git

(cherry picked from commit 642584fd23caddf04132817a0d051c4a7938449a)
---
 .gitattributes | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.gitattributes b/.gitattributes
index 3ca6164b38..e884ab8909 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,10 @@
 *.snap binary
 *.xlog binary
+*.c diff=cpp
+*.h diff=cpp
+*.cc diff=cpp
+*.hh diff=cpp
+*.cpp diff=cpp
+*.hpp diff=cpp
+*.c++ diff=cpp
+*.h++ diff=cpp
-- 
GitLab