2016-08-03 16 views
0

私はgit repos AとBをVisual Studio Team Servicesプロジェクトに持っています。 Bは.gitmodulesに以下の設定を持つのサブモジュールである:VSTS git buildがgit submoduleで失敗する

[submodule "my_submodule"] 
    path = somefolder/my_submodule 
    url = https://xxx.visualstudio.com/xxx/_git/B 

私はオプションリポジトリ/チェックアウトサブモジュールでビルドを行うと、私は次のエラーを取得する:

Repository type=TfsGit 
localPath=C:\a\1\s 
clean=False 
sourceBranch=refs/heads/submoduletest 
sourceVersion=0378dd86db31e4d7bff8de86a482b3d8e72dd3ba 
Syncing repository: A (Git) 
repository url=https://xxx.visualstudio.com/_git/A 
checkoutSubmodules=True 
Starting clone 
Checking out 0378dd86db31e4d7bff8de86a482b3d8e72dd3ba to C:\a\1\s with submodules 
Checked out branch refs/heads/submoduletest for repository A at commit 0378dd86db31e4d7bff8de86a482b3d8e72dd3ba 
##[error]LibGit2Sharp.NotFoundException: Failed to resolve path 'C:/a/1/s/xxx/somefolder/my_submodule/.git': The system cannot find the path specified. 
##[error] at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) 
##[error] at LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.DoUpdateSubmodules(Repository repository, Int32 maxRecursionDepth, Int32 currentRecursionDepth, String username, String password, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.UpdateSubmodules(ITaskEndpoint endpoint, Repository repository, Int32 maxRecursionDepth, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0() 
##[error]Microsoft.TeamFoundation.DistributedTask.Agent.Common.AgentExecutionTerminationException: Prepare repository failed with exception. ---> LibGit2Sharp.NotFoundException: Failed to resolve path 'C:/a/1/s/xxx/somefolder/my_submodule/.git': The system cannot find the path specified. 
##[error] at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) 
##[error] at LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.DoUpdateSubmodules(Repository repository, Int32 maxRecursionDepth, Int32 currentRecursionDepth, String username, String password, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.UpdateSubmodules(ITaskEndpoint endpoint, Repository repository, Int32 maxRecursionDepth, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken) 
##[error] at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0() 
##[error] --- End of inner exception stack trace --- 
##[error] at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0() 
##[error] at System.Threading.Tasks.Task.Execute() 

興味深いエラーメッセージは次のようになります:

LibGit2Sharp.NotFoundException: Failed to resolve path 'C:/a/1/s/xxx/somefolder/my_submodule/.git' 

私のマスキンの作品には再帰的な作品があります。 https://www.visualstudio.com/en-us/docs/build/define/repository

しかし、これは認証については何も言わないし、でも.gitmodulesで相対パスを使用すると、さまざまなエラーメッセージが表示されていません:

幻想ドキュメントは、認証の問題を指摘しています。

アイデア?

更新1

私はブランチを使用しました。私はマスターし、再試行して変更(サブモジュールを追加すること)を吸収合併 - 今、次のエラーで:

##[error]LibGit2Sharp.NotFoundException: Object not found - no matching loose object (4fa408bc7b29e87b7032e0f78998516ff4a4da00) 

ハッシュは私のサブモジュールのHEADであることを - 明確に利用できます。

答えて

0

@ eddie-msftは彼のコメントで正しいです:マスターに同じ名前のフォルダがありました。私のテストブランチにチェックアウトしてもフォルダは削除されませんでした。これはローカルで行うと機能しますが、VS Team Serivicesには問題があるようです。

しかし、別の問題がありました。ドキュメントに反して、私はサブモジュール(https://xxx.visualstudio.com/xxx/_git/B)に完全なURLを提供するために帽子をかぶっています。ドキュメントには、相対URL(../Bまたは../../B-推測ゲーム)を使用する必要があると書かれていますが、動作しません。

0

.gitmodulesファイルに問題があります。通常、ファイル内のパスはサブモジュールリポジトリ名(シナリオでは "B")にする必要があります。

+0

必ずしも、$ git submodule add を使用して、サブフォルダが "somefolder/my_submodule"フォルダにチェックアウトされるようにしました。私のマシンで動作します。 – kuechlerm

+0

@kuechlerm次に、相対パスで試してみる必要があります:https://www.visualstudio.com/en-us/docs/build/define/repository#what-kinds-of-submodules-can-i-check-out –

+0

運がない、同じ結果 – kuechlerm

関連する問題