Skip to content
Snippets Groups Projects
Commit 6a23dc6c authored by Caleb Maclennan's avatar Caleb Maclennan
Browse files

Change handling of conflicts to keep extant local objects.

parent 11925032
No related branches found
No related tags found
No related merge requests found
...@@ -140,15 +140,16 @@ clone() { ...@@ -140,15 +140,16 @@ clone() {
exit exit
fi fi
git fetch git fetch
# TODO: find a way to do this with less tool dependencies and cludges, possibly
# utilizing `git stash` to store local changes before merging (stash can't be
# used on a fresh clone without at least one commit)
for object in $(git ls-tree -r origin/master | awk '{print $4}'); do for object in $(git ls-tree -r origin/master | awk '{print $4}'); do
[ -e "$object" ] && [ -e "$object" ] &&
error "'$object' exists." && mv "$object" "$object.vcsh-unclobber"
VCSH_CONFLICT=1; VCSH_CONFLICT=1;
done done
[ "$VCSH_CONFLICT" = '1' ] &&
fatal "will stop after fetching and not try to merge!
Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning.\n" 17
git merge origin/master git merge origin/master
[ "$VCSH_CONFLICT" = '1' ] && find -name '*.vcsh-unclobber' -execdir rename .vcsh-unclobber '' {} \;
} }
delete() { delete() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment