Git clone stops if changeset is rename
See original GitHub issueIf a tfs checkin contains a deletion or rename of a directory (= is a rename checkin) the clone operation stopps at that changeset and doesn’t fetch newer changesets. Only workaround is to use the quick-clone command.
I think I identified the code that causes that bug but I am not sure, if there is some purpose behind this block. The following return causes the code to not fetch any newer commits than the one with the rename:
GitTfsRemote.cs Line 361
if (changeset.IsRenameChangeset && !isFirstCommitInRepository)
{
if (renameResult == null || !renameResult.IsProcessingRenameChangeset)
{
fetchResult.IsProcessingRenameChangeset = true;
fetchResult.LastParentCommitBeforeRename = MaxCommitHash;
return fetchResult;
}
renameResult.IsProcessingRenameChangeset = false;
renameResult.LastParentCommitBeforeRename = null;
}
Version used: current master branch Reproduction: Clone a repository with a changeset that contains a rename checkin. Command: clone (fetch should be affected too but I didn’t tested that) Output: see attachment CloneDebugOutput.txt
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
git - Does renaming remote repo affect cloned repo?
2 Answers. Renaming shouldn't have an impact on the connection between your local and the remote repository.
Read more >Git - git-clone Documentation
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -- ......
Read more >How to rename a Git repository's folder on my computer ...
Looks like you are asking about folder where git maps your branches if that is the case then you can clone another branch...
Read more >Git happens! 6 Common Git mistakes and how to fix them
When working on an existing project, you can use the clone command to create a copy of your remote rep in GitLab and...
Read more >Change a directory name in a Github repository remotely ...
So let's start by cloning the git repository first: ... then push these changes to the remote copy of the repository, in this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We have the same issue. In our case, the commit in question was an extensive change in the project architecture and we basically moved everything. The ChangeType value of the changes in the changeset all have a value that starts with 2000 and the root folder with git-Path “” has the value 2080. This causes the method
RenameBranchCommmit
of theChangeSieve
class to return true, because the value 2080 encodes the delete flag:As you can see, the other flag is set for
SourceRename
which is mentioned in Microsoft’s documentation of the ChangeType but is not yet included in the ChangeType enumeration of git tfs. The value 0x800 has been determined by looking into the Microsoft.TeamFoundation.VersionControl.Client assembly using dotPeek.I temporarily modified the code of the
RenameBranchCommmit
class to this:(I also added
SourceRename
to theTfsChangeTypeEnum
)With this change, I was able to check out everything, however the changes performed in this problematic commit are not applied (so in our case, we have new and old code folders in the same directory).
I performed the analysis with the current master branch. The aforementioned pull request did not resolve the issue.
We have encountered this same (or at least a related) issue. In our case, we moved several folders between TFS folders but made no other changes to the files. Git tfs clone did not pick up the folders that got moved into the new area.