Skip to content
This repository was archived by the owner on Mar 18, 2018. It is now read-only.

Fix workspace cleaning on Windows. #135

Closed

Conversation

MartyHub
Copy link

@MartyHub MartyHub commented Feb 1, 2017

Hello,

I'm using Shipit on Windows with Git Bash and got the following error when running it twice :

Repository fetched.
Checking out commit-ish "XXX"
Running "git checkout XXX" on local.
@ Your branch and 'XXX' have diverged,
@ and have 1 and 1 different commits each, respectively.
@   (use "git pull" to merge the remote branch into yours)
@ Already on 'XXX'
Checked out.
Resetting the working tree
Running "git reset --hard HEAD" on local.
@ HEAD is now at XXX
Reset working tree.
Testing if commit-ish is a branch.
Running "git branch --list XXX" on local.
@ * XXX
Commit-ish is a branch, merging...
Running "git merge XXX" on local.
@ fatal: refusing to merge unrelated histories

I think this is because the workspace is not well deleted at the beginning of the process (mess between /tmp and /c/tmp) :

Deleting existing workspace "/tmp/XXX"
Running "rm -rf /tmp/XXX" on local.
Create workspace "/tmp/XXX"
Workspace created.
Initialize local repository in "/tmp/XXX"
Running "git init" on local.
@ Reinitialized existing Git repository in C:/tmp/XXX/.git/

This patch aims to fix this process.

Thanks and regards

@MartyHub MartyHub force-pushed the fix-workspace-cleaning-on-windows branch from 1f8af70 to 36c05e1 Compare February 1, 2017 11:21
@timkelty
Copy link
Member

@MartyHub can you include tests?

@pbarbiero
Copy link
Contributor

@timkelty if @MartyHub cant get time, I would be happy to add tests as I also run into this issue occasionally.

However it looks like Marty did update the one test thats impacted, if you want more can you possibly point me at what you would like added specifically?

@pbarbiero
Copy link
Contributor

@timkelty @neoziro any chance of reviewing this?

@gregberge
Copy link
Member

@pbarbiero it looks very weird, did you try to add quotes?

@pbarbiero
Copy link
Contributor

Im only a windows user, and this pull works for me. I just have no idea how it affects the other OSes.

@gregberge
Copy link
Member

@pbarbiero I think it is too dangerous, in v4 I added integration test. I could test it. But no integration test on Windows yet sorry.

@pbarbiero
Copy link
Contributor

@neoziro Understood. Would you mind if I make a pull using https://github.com/isaacs/rimraf instead then?

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

Successfully merging this pull request may close these issues.

4 participants