-if pack_writer and opt.blobs:
- shalist = hashsplit.split_to_blobs(pack_writer.new_blob, files,
+if pack_writer:
+ new_blob = pack_writer.new_blob
+ new_tree = pack_writer.new_tree
+elif opt.blobs or opt.tree:
+ # --noop mode
+ new_blob = lambda content: git.calc_hash('blob', content)
+ new_tree = lambda shalist: git.calc_hash('tree', git.tree_encode(shalist))
+
+if opt.blobs:
+ shalist = hashsplit.split_to_blobs(new_blob, files,