The sTeam/server/factories/DocumentFactory.pike has provision for autodetecting the Mime type of the object to be created using the import-from-git script. #define _TYPES _Server->get_module("types") from the /server/include/database.h refers to the module /server/modules/types.pike.
The types.pike module has all the features to auto-detect the mime-type of an object.
The contents of the files with Mimetypes other than text type are not updated successfully. The Stdout of the process to get the contents of a file was not able to read the contents in string format. An alternative way to do so was found and updated.