Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1b8d3247
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1b8d3247
编写于
11月 02, 2015
作者:
V
Valery Sizov
提交者:
Valery Sizov
11月 02, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add ability to fetch the commit ID of the last commit that actually touched a file
上级
8f75200d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
2 deletion
+7
-2
CHANGELOG
CHANGELOG
+1
-0
doc/api/repository_files.md
doc/api/repository_files.md
+2
-1
lib/api/files.rb
lib/api/files.rb
+3
-1
spec/requests/api/files_spec.rb
spec/requests/api/files_spec.rb
+1
-0
未找到文件。
CHANGELOG
浏览文件 @
1b8d3247
...
...
@@ -16,6 +16,7 @@ v 8.2.0 (unreleased)
- Fix: 500 error returned if destroy request without HTTP referer (Kazuki Shimizu)
- Remove deprecated CI events from project settings page
- Use issue editor as cross reference comment author when issue is edited with a new mention.
- [API] Add ability to fetch the commit ID of the last commit that actually touched a file
v 8.1.1
- Fix cloning Wiki repositories via HTTP (Stan Hu)
...
...
doc/api/repository_files.md
浏览文件 @
1b8d3247
...
...
@@ -23,7 +23,8 @@ Example response:
"content"
:
"IyA9PSBTY2hlbWEgSW5mb3..."
,
"ref"
:
"master"
,
"blob_id"
:
"79f7bbd25901e8334750839545a9bd021f0e4c83"
,
"commit_id"
:
"d5a3ff139356ce33e37e73add446f16869741b50"
"commit_id"
:
"d5a3ff139356ce33e37e73add446f16869741b50"
,
"last_commit_id"
:
"570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
}
```
...
...
lib/api/files.rb
浏览文件 @
1b8d3247
...
...
@@ -43,7 +43,8 @@ module API
# "content": "IyA9PSBTY2hlbWEgSW5mb3...",
# "ref": "master",
# "blob_id": "79f7bbd25901e8334750839545a9bd021f0e4c83",
# "commit_id": "d5a3ff139356ce33e37e73add446f16869741b50"
# "commit_id": "d5a3ff139356ce33e37e73add446f16869741b50",
# "last_commit_id": "570e7b2abdd848b95f2f578043fc23bd6f6fd24d",
# }
#
get
":id/repository/files"
do
...
...
@@ -71,6 +72,7 @@ module API
ref:
ref
,
blob_id:
blob
.
id
,
commit_id:
commit
.
id
,
last_commit_id:
user_project
.
repository
.
last_commit_for_path
(
commit
.
sha
,
file_path
).
id
}
else
not_found!
'File'
...
...
spec/requests/api/files_spec.rb
浏览文件 @
1b8d3247
...
...
@@ -19,6 +19,7 @@ describe API::API, api: true do
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
'file_path'
]).
to
eq
(
file_path
)
expect
(
json_response
[
'file_name'
]).
to
eq
(
'popen.rb'
)
expect
(
json_response
[
'last_commit_id'
]).
to
eq
(
'570e7b2abdd848b95f2f578043fc23bd6f6fd24d'
)
expect
(
Base64
.
decode64
(
json_response
[
'content'
]).
lines
.
first
).
to
eq
(
"require 'fileutils'
\n
"
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录