Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
0b3623ac
Commit
0b3623ac
authored
Mar 11, 2017
by
Carlos Martín Nieto
Committed by
GitHub
Mar 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4156 from libgit2/ethomson/readbuffer_dont_hash
git_futils_readbuffer: don't compute sha-1
parents
ffd4df6b
11c8e756
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/fileops.c
+16
-15
No files found.
src/fileops.c
View file @
0b3623ac
...
...
@@ -196,28 +196,29 @@ int git_futils_readbuffer_updated(
p_close
(
fd
);
if
((
error
=
git_hash_buf
(
&
checksum_new
,
buf
.
ptr
,
buf
.
size
))
<
0
)
{
git_buf_free
(
&
buf
);
return
error
;
}
if
(
checksum
)
{
if
((
error
=
git_hash_buf
(
&
checksum_new
,
buf
.
ptr
,
buf
.
size
))
<
0
)
{
git_buf_free
(
&
buf
);
return
error
;
}
/*
* If we were given a checksum, we only want to use it if it's different
*/
if
(
checksum
&&
!
git_oid__cmp
(
checksum
,
&
checksum_new
))
{
git_buf_free
(
&
buf
);
if
(
updated
)
*
updated
=
0
;
/*
* If we were given a checksum, we only want to use it if it's different
*/
if
(
!
git_oid__cmp
(
checksum
,
&
checksum_new
))
{
git_buf_free
(
&
buf
);
if
(
updated
)
*
updated
=
0
;
return
0
;
return
0
;
}
git_oid_cpy
(
checksum
,
&
checksum_new
);
}
/*
* If we're here, the file did change, or the user didn't have an old version
*/
if
(
checksum
)
git_oid_cpy
(
checksum
,
&
checksum_new
);
if
(
updated
!=
NULL
)
*
updated
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment