-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Labels
Description
When running gitversion
command on a scripted pipeline inside Jenkins I get
INFO [01/29/19 15:26:08:49] IsDynamicGitRepository: False
INFO [01/29/19 15:26:08:55] Returning Project Root from DotGitDirectory: D:\workspace\myproject\myrepo\feature-yadda-yadda-yadda-messages-lol-ok\.git - D:\workspace\myproject\myrepo\feature-yadda-yadda-yadda-messages-lol-ok
INFO [01/29/19 15:26:08:56] Running on Windows.
INFO [01/29/19 15:26:08:57] Applicable build agent found: 'Jenkins'.
INFO [01/29/19 15:26:08:57] Branch from build environment: feature-yadda-yadda-yadda-messages-lol-ok
INFO [01/29/19 15:26:08:57] Begin: Normalizing git directory for branch 'feature-yadda-yadda-yadda-messages-lol-ok'
INFO [01/29/19 15:26:09:24] One remote found (origin -> 'myremote.git').
INFO [01/29/19 15:26:09:24] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [01/29/19 15:26:09:28] Updating local branch refs/heads/feature-yadda-yadda-yadda-messages-lol-ok to match ref feature-yadda-yadda-yadda-messages-lol-ok
INFO [01/29/19 15:26:09:42] End: Normalizing git directory for branch 'feature-yadda-yadda-yadda-messages-lol-ok' (Took: 847.00ms)
ERROR [01/29/19 15:26:09:51] An unexpected error occurred:
LibGit2Sharp.LibGit2SharpException: invalid path '\\?\D:\workspace\myproject\myrepo\feature-yadda-yadda-yadda-messages-lol-ok\extremelylongfoldername\extremelylongfoldername\extremelylongfoldername\extremelylongfoldername\extremelylongfoldername\' (path too long)
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositoryHandle repo, ObjectId treeId, GitCheckoutOpts& opts)
at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts)
at LibGit2Sharp.Commands.Checkout(IRepository repository, Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec)
at LibGit2Sharp.Commands.Checkout(IRepository repository, Branch branch, CheckoutOptions options)
at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec, CheckoutOptions options)
at GitTools.Git.GitRepositoryHelper.EnsureLocalBranchExistsForCurrentBranch(Repository repo, Remote remote, String currentBranch)
at GitTools.Git.GitRepositoryHelper.NormalizeGitDirectory(String gitDirectory, AuthenticationInfo authentication, Boolean noFetch, String currentBranch)
at GitVersion.GitPreparer.Initialise(Boolean normaliseGitDirectory, String currentBranch, Boolean shouldCleanUpRemotes)
at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
at GitVersion.Program.VerifyArgumentsAndRun()
INFO [01/29/19 15:26:09:51]
INFO [01/29/19 15:26:09:51] Attempting to show the current git graph (please include in issue):
INFO [01/29/19 15:26:09:51] Showing max of 100 commits
INFO [01/29/19 15:26:09:83] * 452f0c536f 11 minutes ago
* 7be1391059 21 minutes ago
* e83c4de2b4 50 minutes ago
|\
| | * f26b0201b3 40 minutes ago
| | |\
| | |/
| |/|
| | * 5a1cbb1466 3 hours ago
| | * a28d69ba19 23 hours ago
| | |\
When I navigate manually to the folder and execute gitversion
it prints out the version correctly. I'm on Windows Server 2019 and have long filepaths enabled.
Why does the command work when I run it outside of the build agent? Is there a way to make it behave the same while running in Jenkins?