Sorry if this is a stupid question with just a yes/no answer, but if I understand correctly, in git a branch is just a pointer to a commit. Doesn't this imply that once you've merged two branches, git doesn't know which one pointed to which set of commits?
Before
A---B---C---D---E <- X
\
1----2----3----4 <- Y
After
A---B---C---D---E--M <-X & Y
\ /
1----2----3----4