  Let $M$ be a $n$-dimensional complex manifold and $f,g:M\to M$ two distinct
holomorphic self-maps. Suppose that $f$ and $g$ coincide on a globally
irreducible compact hypersurface $S\subset M$. We show that if one of the two
maps is a local biholomorphism around $S'=S-\text{Sing}(S)$ and, if needed,
$S'$ sits into $M$ in a particular nice way, then it is possible to define a
$1$-dimensional holomorphic (possibly singular) foliation on $S'$ and partial
holomorphic connections on certain holomorphic vector bundles on $S'$. As a
consequence, we are able to localize suitable characteristic classes and thus
to get index theorems.
