Use JGit TreeWalk to list files and folders

前端 未结 2 1520
野的像风
野的像风 2021-02-19 04:25

I\'d like to use JGit to display a list of all files and folders for the head revision. I\'m able to list all files using TreeWalk, but this does not list folders.

Here

2条回答
  •  时光说笑
    2021-02-19 05:05

    Git does not track directories of their own. You can only derive non-empty directory names from the path string you get from the TreeWalk.

    See the Git FAQ (search for 'empty directory') for a detailed explanation and possible workarounds.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题