git-apply: normalize file mode when comparing with expected value

Sine git only saves the 'x' bit, we shouldn't compare the stat contents
directly.
This commit is contained in:
Linus Torvalds 2005-06-13 20:41:38 -07:00
parent 940c1bb018
commit de4971b500

View file

@ -1000,6 +1000,7 @@ static int check_patch(struct patch *patch)
}
if (patch->is_new < 0)
patch->is_new = 0;
st.st_mode = ntohl(create_ce_mode(st.st_mode));
if (!patch->old_mode)
patch->old_mode = st.st_mode;
if ((st.st_mode ^ patch->old_mode) & S_IFMT)