  It has been shown recently that the geometry of D-branes in general
topologically twisted (2,2) sigma-models can be described in the language of
generalized complex structures. On general grounds such D-branes (called
generalized complex (GC) branes) must form a category. We compute the BRST
cohomology of open strings with both ends on the same GC brane. In mathematical
terms, we determine spaces of endomorphisms in the category of GC branes. We
find that the BRST cohomology can be expressed as the cohomology of a Lie
algebroid canonically associated to any GC brane. In the special case of
B-branes, this leads to an apparently new way to compute Ext groups of
holomorphic line bundles supported on complex submanifolds: while the usual
method leads to a spectral sequence converging to the Ext, our approach
expresses the Ext group as the cohomology of a certain differential acting on
the space of smooth sections of a graded vector bundle on the submanifold. In
the case of coisotropic A-branes, our computation confirms a proposal of D.
Orlov and one of the authors (A.K.).
