-
Notifications
You must be signed in to change notification settings - Fork 868
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
[BUG]: .git/shallow file not removed with fetchDepth: 0 #4419
Comments
I'm getting this too. My develop branch build is OK but not my release branch build. For my release branch, GitVersion is complaining about a shallow repo even though I can turn this off in the YAML settings and also explicitly set the checkout depth to 0 (and also max 2147483647) in the pipeline yaml to no effect. |
Just following up on this, I solved the problem by running these tasks immediately after the checkout to list and remove the shallow file directly:
It's like the --unshallow command wasn't able to remove the shallow file, perhaps due to a rights issue? Incidentally, I turned on debug to see what was going on but the shallow file didn't come back and looking at the git command it didn't use the OS: Windows Server 2012 R2 Standard |
I was also experiencing this issue with several pipelines, and most of the time I was able to get around it with some combination of the shallow fetch / fetchDepth options that Microsoft did provide. However, for one of the pipelines, doing any of those combinations simply didn't work. @RustyF 's workaround helped to fix the issue one time, but then I re-did the pipeline yaml commit and for some reason it made the --unshallow totally disappear (and caused the PowerShell task to fail). If this bug could be fixed so that having the unshallow does its job properly, that would save a lot of headache and hours of troubleshooting. OS: Linux X64 |
Adding "same here",
|
Found this issue a little bit too late, ran into the same problem in order to get GitVersion working in my pipeline. I raised the issue on StackOverflow and came out with a work-around: https://stackoverflow.com/questions/78569253/azure-devops-task-fails-to-checkout-disabling-shallow workspace:
clean: all
steps:
- checkout: self
fetchDepth: 0
fetchTags: true
clean: true
displayName: Checkout and clean The combination of Workspace |
@nikneem I also understand that it is still a bug because if in order to change the I don't know which user has Alvin Zhao on GitHub, because I would like him to give us an answer at least to see if they intend to fix this problem or not. |
Can confirm that I have this issue also - presented initially as gitversion thinking the Azure clone was shallow when it clearly was not shallow and was verified as such with steps prior to running gitversion. Similar to this: https://stackoverflow.com/questions/78569253/azure-devops-task-fails-to-checkout-disabling-shallow |
What happened?
I am encountering a similar problem to the one this user is experiencing:
https://www.reddit.com/r/git/comments/1118tz1/fetch_unshallow_still_producing_a_shallow_result/
And that is that running the following yml:
I can't convert the working copy of git from shallow to unshallow correctly as the
.git/shallow
file is still there and SonarCloud detects it and gives me a warning:The log of the checkout step pulls these commands with
--unshallow
:But the
.git/shallow
file is not removed.What determines that the .git/shallow file should be deleted?
Versions
3.225.0
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows 11
Version controll system
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: