Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Investigate file deletions #29

Open
gjtorikian opened this issue Jan 7, 2017 · 1 comment
Open

Investigate file deletions #29

gjtorikian opened this issue Jan 7, 2017 · 1 comment

Comments

@gjtorikian
Copy link
Owner

They do not appear to be syncing to the other repository.

@nuclearsandwich
Copy link
Collaborator

If I recall from previous investigations, the lack of proper deletion handling is due to the way git porcelain commands are used with the squash and merge options. The replace_contents option should create a single commit that makes the receiving repository contents match exactly the source repository contents.

# Using HEAD here is likely the best thing since HEAD will be a pointer to
# the head of the branch we checked out earlier and is likely more reliable
# than manually trying to use "refs/heads/#{branch_name}"
def replace_contents
logger.info "Committing contents of #{originating_repo}/master into #{branch_name} directly..."
commit_id = run_command('git', 'commit-tree', "#{remote_name}/master^{tree}", '-p', 'HEAD', '-m', commit_message)
run_command('git', 'update-ref', 'HEAD', commit_id.chomp)
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants