首页 > 其他分享 >repo sync error: cannot initialize work tree

repo sync error: cannot initialize work tree

时间:2023-09-06 13:07:21浏览次数:38  
标签:py work tree sync repo home line panos


repo sync时其他操作导致电脑死机,重启后继续repo时,出现如下错误:

$ repo sync -cdf
Syncing work tree:  67% (344/512)  fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/panos/android/cm13/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/panos/android/cm13/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/panos/android/cm13/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/panos/android/cm13/.repo/repo/subcmds/sync.py", line 769, in Execute
    project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
  File "/home/panos/android/cm13/.repo/repo/project.py", line 1247, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "/home/panos/android/cm13/.repo/repo/project.py", line 2393, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree


这是因为第一次repo sync到某个porject时,由于关机导致这个project的内容出现错误

解决方法:

1 先用repo --trace sync -cdf将repo的所有动作详细输出,

会发现在这里出错导致:

: export GIT_DIR=......./vendor/mediatek/proprietary/hardware/gsm0710muxd
: git rev-parse --verify refs/remotes/github/cm-13.0-caf-8996^0 1>| 2>|


: cd ......../vendor/mediatek/proprietary/hardware/gsm0710muxd
: git read-tree --reset -u -v HEAD 1>| 2>|
fatal: This operation must be run in a work tree
Traceback (most recent call last):
  File "/home/panos/android/cm13/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/panos/android/cm13/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/panos/android/cm13/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/panos/android/cm13/.repo/repo/subcmds/sync.py", line 769, in Execute
    project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
  File "/home/panos/android/cm13/.repo/repo/project.py", line 1247, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync)
  File "/home/panos/android/cm13/.repo/repo/project.py", line 2393, in _InitWorkTree
    raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree

2 因此,将vendor/mediatek/proprietary/hardware/gsm0710muxd这个文件夹删除,在manifest中查找这个路径对应的project是

 <project name="alps/vendor/mediatek/proprietary/hardware/gsm0710muxd" path="vendor/mediatek/proprietary/hardware/gsm0710muxd" />

于是,在.repo/projects下删除.repo/projects/vendor/mediatek/proprietary/hardware/gsm0710muxd.git目录,以及

.repo/project-objects/vendor/mediatek/proprietary/hardware/gsm0710muxd.git目录


3 最后重新repo sync即可


repo的trace选项的作用

You can trace what really happens with repo --trace init ...

标签:py,work,tree,sync,repo,home,line,panos
From: https://blog.51cto.com/u_16248677/7385128

相关文章

  • 记一次生产项目Kubesphere中NS加入Workspace,致使NS数据删除事故
    一、前言2023年7月23日在项目上线前夕,k8s生产环境出现故障,经过紧急修复之后,k8s环境恢复正常;另外我们环境引入了kubesphere云原生平台技术,为了方便研发人员对于k8s权限的细粒度管理,我方手动将kubernetesnamespace(生产环境业务命名空间)加入到kubesphere中的workspace(企业空间),就在此......
  • C++异步框架workflow分析
    简述workflow项目地址:https://github.com/sogou/workflowworkflow是搜狗开源的一个开发框架。可以满足绝大多数日常服务器开发,性能优异,给上层业务提供了易于开发的接口,却只用了少量的代码,举重若轻,而且代码整洁干净易读。搜狗官方宣传强调,workflow是一个异步任务调度编程范式,封......
  • Proj CDeepFuzz Paper Reading: Framework for Evaluating Faithfulness of Local Exp
    Abstract本文:Task:1.studythefaithfulnessofanexplanationsystemtotheunderlyingpredictionmodelonconsistencyandsufficiency2.introducequantitativemeasuresofconsistencyandsufficiency3.provideestimatorsandsamplecomplexityboundsfo......
  • 10分钟从源码级别搞懂AQS(AbstractQueuedSynchronizer)
    10分钟从源码级别搞懂AQS(AbstractQueuedSynchronizer)前言上篇文章15000字、6个代码案例、5个原理图让你彻底搞懂Synchronized有说到synchronized由objectmonitor实现的objectmonitor中由cxq栈和entrylist来实现阻塞队列,waitset实现等待队列,从而实现synchronized的等待/通知......
  • OpenTK 入门 Vsync 垂直同步对刷新率的影响
    本文将和大家介绍Vsync垂直同步的开启对OpenTK应用的刷新率的影响在上一篇博客OpenTK入门初始化窗口告诉了大家如何初始化OpenTK承载OpenGL的窗口的应用,在上一篇博客基础上,咱尝试修改创建MainWindow的参数,从而测试Vsync垂直同步对刷新率的影响回顾上一篇博客提......
  • CF1695D2 Tree Queries (Hard Version)
    原题翻译\[\large{\color{#ff0000}{\text{被xjk搏杀了,wtcl}}}\]先说以下自己的思路,\(xjk\)提出让我手玩一下样例,发现确实挺有用的我们看这个\(2\)是怎么来的,我们发现有一种答案是选\(\{5,8\}\),我们发现不能选\(\{5,10\}\)的原因是我们无法确定\(8\)和\(9\)的区别于是我想如......
  • OpenHarmony Framework层开发笔记
    OH源码版本:OpenHarmony-v3.2-Beta52023.04.04由于需要裁剪系统APP,原本想法是在/applications/standard/hap/BUILD.gn增加一个part的但是最后发现vendor下有现成的裁剪APP的json配置文件,所以使用gitreset还原了/applications/standard/hap/仓库下的修改导致此仓库下的所有hap......
  • error: The following untracked working tree files would be overwritten by merge
    错误内容如下:error:Thefollowinguntrackedworkingtreefileswouldbeoverwrittenbymerge: xxx/xxx/xxx/xxx/xxx/xxx/xxx.java Pleasemoveorremovethembeforeyoucanmerg      gitclean-d-fx 删除没有被上传的文件TRANSL......
  • Proj CDeepFuzz Paper Reading: DeepTest: automated testing of deep-neural-network
    Abstract本文:DeepTestTask:asystematictestingtoolforDNN-drivenvehiclesMethod:generatedtestcaseswithreal-worldchangeslikerain,fog,lightingconditions,etc.maxthenumberofactivatedneuronsGithub:https://github.com/ARiSE-Lab/deepTes......
  • 15、HSSFWorkbook实现动态指定字段导出
    一、自定义注解标记对象属性:1、声明注解:importjava.lang.annotation.ElementType;importjava.lang.annotation.Retention;importjava.lang.annotation.RetentionPolicy;importjava.lang.annotation.Target;@Target({ElementType.METHOD,ElementType.FIELD})@Retenti......