Remember the movie: "Glory"? Mathew Broderick starred as Col. Robert Gould Shaw who leads the first all African-American volunteer unit in the Civil War. Worth watching for the history.
That said, and through historical research, blacks were not allowed to be officers, so all officers in designated "Negro" unites, were white. Perfectly reasonable to find white ancestors then to be listed in all black units.
I have found one of my own ancestors who was a white officer in an all black unit hence the research, and I watched the movie again!
Happy Hunting! Sheryl