CruiseControl.NET使用TFS挂起git-submodule坏文件描述符

时间:2015-08-21 12:20:30

标签: git tfs cruisecontrol.net

使用CruiseControl.NET 1.8.5版本在git中获取子模块时遇到问题。我刚刚更新到msysgit 64bit v2.5.0并更改了配置以使用新版本。

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 535: 0: Bad file descriptor
. Process command: C:\Program Files\Git\bin\git.exe submodule foreach --recursive "git clean -d -f -x"
  bei ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
  bei ThoughtWorks.CruiseControl.Core.Sourcecontrol.Git.GitClean(IIntegrationResult result)
  bei ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build(IIntegrationResult result)
  bei ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)

如果我将项目配置更改为

<sourcecontrol type="git">
  <repository>$(tfsServerPath)/softwarename</repository>
  <branch>$(dev)</branch>
  <autoGetSource>true</autoGetSource>
  <fetchSubmodules>false</fetchSubmodules>
  ...
</sourceControl>

它适用于没有子模块的项目。什么可能在这里出错?

亲切的问候

1 个答案:

答案 0 :(得分:1)

这是一种解决方法:

<sourcecontrol type="multi">
  <sourceControls>
    <git>
      <workingDirectory>src_dir</workingDirectory>         
    </git>
  </sourceControls>
</sourcecontrol>

<tasks>
  <exec>
    <executable>git</executable>
    <buildArgs>submodule init</buildArgs>
    <baseDirectory>src_dir</baseDirectory>
  </exec>
  <exec>
    <executable>git</executable>
    <buildArgs>submodule update</buildArgs>
    <baseDirectory>src_dir</baseDirectory>
  </exec>
</tasks>