lib/autoproj/ops/snapshot.rb in autoproj-1.13.0.b4 vs lib/autoproj/ops/snapshot.rb in autoproj-1.13.0.b5
- old
+ new
@@ -227,28 +227,28 @@
cacheinfo = ["100644", object_id, path]
if Autobuild::Git.at_least_version(2, 1)
cacheinfo = cacheinfo.join(",")
end
+ parent_id ||= importer.rev_parse(pkg, 'HEAD')
+
# Create the tree using a temporary index in order to not mess with
# the user's index state. read-tree initializes the new index and
# then we add the overrides file with update-index / write-tree
our_index = File.join(importer.git_dir(pkg, false), 'index.autoproj')
FileUtils.rm_f our_index
begin
ENV['GIT_INDEX_FILE'] = our_index
- importer.run_git_bare(pkg, 'read-tree', 'HEAD')
+ importer.run_git_bare(pkg, 'read-tree', parent_id)
# And add the new file
importer.run_git_bare(
pkg, 'update-index',
'--add', '--cacheinfo', *cacheinfo)
tree_id = importer.run_git_bare(pkg, 'write-tree').first
ensure
ENV.delete('GIT_INDEX_FILE')
FileUtils.rm_f our_index
end
-
- parent_id ||= importer.rev_parse(pkg, 'HEAD')
importer.run_git_bare(
pkg, 'commit-tree',
tree_id, '-p', parent_id, input_streams: [message]).first
end