-
Notifications
You must be signed in to change notification settings - Fork 724
Delete Orphan folder when last file is deleted #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This might work. I want to play around with it a bit before a 👍 or 👎. Specifically, I'm interested in ...
|
if there is still a file in tfs, does tfs prevent you from accidentally deleting it, or does it just recursively delete the file? If unintentional removal does happen, we'll probably have to ask tfs about the dir contents before deleting. I think this is covered, but what happens if the last existing file is removed and another file is added? PS : I can test nothing because I'm on holdays. Work will restart with the new year ;) and I will not answer anymore in comments too... |
Happy holidays, Merry Christmas, Happy New Year! See you in 2013! 🎆 |
(modifications are a little ugly, now :( )
I now look to the TFS tree (and manage file moved/renamed) but it become more and more ugly, I think (but perhaps there is no better solution........) |
@@ -11,6 +11,18 @@ namespace Sep.Git.Tfs.Core | |||
{ | |||
public class GitChangeInfo | |||
{ | |||
public struct ChangeType | |||
{ | |||
public const string ADD = "A"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe LibGit2Sharp has constants for these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look but it seems no...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChangeKind? I swear we have somewhere in the code that maps between that and what we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm thinking of what I did in b0eb392
I'm getting a little bit less enthused with the patch as I keep looking it over. We're creating new structs/enums to parse out the change type, just because we haven't bitten the bullet and switched over to using LibGit2Sharp to read out these statuses. Maybe we should go ahead and refactor |
I think checking the TFS "tree" is the right approach. I'd like this to be decoupled more, though. Could it be done as a second pass inside of PendChangesToWorkspace(), after applying the git diff, rather than embedded into GetChangedFiles? |
@sc68cal I don't really understand your point of view... And correcting this bug (this way or another) instead of waiting the end of the refactor is in my opinon better... |
@sc68cal Before refactoring |
Cool. Thanks @kgybels ! |
Any idea when this change is going to get pulled in? |
@iSynaptic - It's not done. I did some of the refactoring I had in mind at spraints/git-tfs@delete-orphans, but I still need to try it out to make sure that it's not broken. |
The return of the commit ;)
I now detect last deleted file using the git tree...