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
1686641f
Commit
1686641f
authored
Oct 05, 2012
by
Sascha Cunz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract submodule logic out of diff_output.c:get_workdir_content
parent
7e57d250
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
src/diff_output.c
+15
-8
No files found.
src/diff_output.c
View file @
1686641f
...
...
@@ -267,18 +267,12 @@ static int get_blob_content(
return
diff_delta_is_binary_by_content
(
ctxt
,
delta
,
file
,
map
);
}
static
int
get_workdir_content
(
static
int
get_workdir_
sm_
content
(
diff_context
*
ctxt
,
git_diff_delta
*
delta
,
git_diff_file
*
file
,
git_map
*
map
)
{
int
error
=
0
;
git_buf
path
=
GIT_BUF_INIT
;
const
char
*
wd
=
git_repository_workdir
(
ctxt
->
repo
);
if
(
file
->
mode
==
GIT_FILEMODE_COMMIT
)
{
git_buf
content
=
GIT_BUF_INIT
;
git_submodule
*
sm
=
NULL
;
const
git_oid
*
sm_head
=
NULL
;
...
...
@@ -312,7 +306,20 @@ static int get_workdir_content(
file
->
flags
|=
GIT_DIFF_FILE_FREE_DATA
;
return
0
;
}
}
static
int
get_workdir_content
(
diff_context
*
ctxt
,
git_diff_delta
*
delta
,
git_diff_file
*
file
,
git_map
*
map
)
{
int
error
=
0
;
git_buf
path
=
GIT_BUF_INIT
;
const
char
*
wd
=
git_repository_workdir
(
ctxt
->
repo
);
if
(
file
->
mode
==
GIT_FILEMODE_COMMIT
)
return
get_workdir_sm_content
(
ctxt
,
file
,
map
);
if
(
git_buf_joinpath
(
&
path
,
wd
,
file
->
path
)
<
0
)
return
-
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