Let $A$ be a commutative ring and $I$ a (finitely generated) ideal in $A$. We denote by $\hat{A}$ the $I$-adic completion of $A$, i.e. $\hat{A} = \varprojlim(A/I \leftarrow A/I^2 \leftarrow \ldots)$.

When do we have $I \otimes_A \hat{A} \cong I\hat{A}$?

It is well known that this is true when $A$ is noetherian (e.g. see Atiyah-MacDonald), but in general $\hat{A}$ is not even flat.

However, when $I$ is finitely generated then we have at least isomorphisms $I^n\hat{A} \cong \widehat{I^nA}$, $A/I^nA \cong \hat{A}/I^n\hat{A}$ and $\hat{A}$ is complete.

In the special case where $I=(f)$ and $f$ is a non-zerodivisor in $A$, we can tensorize

$0 \rightarrow A \stackrel{\cdot f}\rightarrow A \rightarrow A/fA \rightarrow 0$

by $\hat{A}$ to see that $(f) \otimes_A \hat{A} \cong f\hat{A}$.

Thus, I hope that for $I$ finitely generated by non-zerodivisors (or at least not containing any zerodivisors) I could obtain a similar result. But I am not sure if this is true. If I try to do a similar trick as above, I get

$0 \rightarrow IA \rightarrow A \rightarrow A/IA \rightarrow 0$

and obtain

$IA \otimes_A \hat{A} \rightarrow \hat{A} \rightarrow \hat{A}/I\hat{A} \rightarrow 0$

using $(A/IA) \otimes_A \hat{A} \cong A/IA \cong \hat{A}/I\hat{A}$. However, it is not clear that this is exact on the left.

Edit: I think I can show by an easy snake lemma argument, that $I \otimes_A \hat{A} \rightarrow I\hat{A}$ is surjective in the setting above, but I still do not see what I need for it to be injective. The problem is that even non-zerodivisors from $IA$ can become zero-divisors in $\hat{A}$, but maybe it is always possible to find a set of generators of $I$ which does not become zero-divisors in $\hat{A}$ and I then could use that? At least in the case $I=(f)$ I could prove that $f$ does not become a zero-divisor.

Edit2: Here my precise question

If $I$ is finitely generated and does not contain any zerodivisors in $A$, is it true that $I \otimes_A \hat{A} \rightarrow I \hat{A}$ is an isomorphism?

If not, what properties can we ask for $I$ and $A$ to have which are weaker than "$A$ noetherian or $I$ principal", such that $I \otimes_A \hat{A} \rightarrow I \hat{A}$ is an isomorphism (e.g. $I$ flat over $A$, ...)?