It seems no one had tried to run a transaction without having an index
and a workdir, but this is exacly the situation we get when operating
on a stack other than the current one.
The fix is simple: don't try to check out.
Signed-off-by: Karl Hasselström <kha@treskal.com>
new_head = self.__head
# Set branch head.
- try:
- self.__checkout(new_head.data.tree, iw)
- except git.CheckoutException:
- # We have to abort the transaction.
- self.abort(iw)
- self.__abort()
+ if iw:
+ try:
+ self.__checkout(new_head.data.tree, iw)
+ except git.CheckoutException:
+ # We have to abort the transaction.
+ self.abort(iw)
+ self.__abort()
self.__stack.set_head(new_head, self.__msg)
if self.__error: