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
83d6327d
Unverified
Commit
83d6327d
authored
Apr 06, 2018
by
Patrick Steinhardt
Committed by
GitHub
Apr 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4611 from erikvanzijst/erik/status_char
diff: Add missing GIT_DELTA_TYPECHANGE -> 'T' mapping.
parents
e0af6d12
cd6a4323
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
src/diff_print.c
+1
-0
tests/checkout/typechange.c
+26
-0
tests/diff/stats.c
+1
-1
No files found.
src/diff_print.c
View file @
83d6327d
...
@@ -130,6 +130,7 @@ char git_diff_status_char(git_delta_t status)
...
@@ -130,6 +130,7 @@ char git_diff_status_char(git_delta_t status)
case
GIT_DELTA_COPIED
:
code
=
'C'
;
break
;
case
GIT_DELTA_COPIED
:
code
=
'C'
;
break
;
case
GIT_DELTA_IGNORED
:
code
=
'I'
;
break
;
case
GIT_DELTA_IGNORED
:
code
=
'I'
;
break
;
case
GIT_DELTA_UNTRACKED
:
code
=
'?'
;
break
;
case
GIT_DELTA_UNTRACKED
:
code
=
'?'
;
break
;
case
GIT_DELTA_TYPECHANGE
:
code
=
'T'
;
break
;
case
GIT_DELTA_UNREADABLE
:
code
=
'X'
;
break
;
case
GIT_DELTA_UNREADABLE
:
code
=
'X'
;
break
;
default:
code
=
' '
;
break
;
default:
code
=
' '
;
break
;
}
}
...
...
tests/checkout/typechange.c
View file @
83d6327d
#include "clar_libgit2.h"
#include "clar_libgit2.h"
#include "diff_generate.h"
#include "git2/checkout.h"
#include "git2/checkout.h"
#include "path.h"
#include "path.h"
#include "posix.h"
#include "posix.h"
...
@@ -307,3 +308,28 @@ void test_checkout_typechange__checkout_with_conflicts(void)
...
@@ -307,3 +308,28 @@ void test_checkout_typechange__checkout_with_conflicts(void)
git_object_free
(
obj
);
git_object_free
(
obj
);
}
}
}
}
void
test_checkout_typechange__status_char
(
void
)
{
size_t
i
;
git_oid
oid
;
git_commit
*
commit
;
git_diff
*
diff
;
const
git_diff_delta
*
delta
;
git_diff_options
diffopts
=
GIT_DIFF_OPTIONS_INIT
;
char
expected
[
8
]
=
{
'M'
,
'M'
,
'R'
,
'T'
,
'D'
,
'R'
,
'A'
,
'R'
};
git_oid_fromstr
(
&
oid
,
"9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a"
);
cl_git_pass
(
git_commit_lookup
(
&
commit
,
g_repo
,
&
oid
));
diffopts
.
flags
|=
GIT_DIFF_INCLUDE_TYPECHANGE
;
cl_git_pass
(
git_diff__commit
(
&
diff
,
g_repo
,
commit
,
&
diffopts
));
cl_git_pass
(
git_diff_find_similar
(
diff
,
NULL
));
for
(
i
=
0
;
i
<
git_diff_num_deltas
(
diff
);
i
++
)
{
delta
=
git_diff_get_delta
(
diff
,
i
);
cl_assert_equal_i
(
expected
[
i
],
git_diff_status_char
(
delta
->
status
));
}
git_diff_free
(
diff
);
git_commit_free
(
commit
);
}
tests/diff/stats.c
View file @
83d6327d
...
@@ -254,7 +254,7 @@ void test_diff_stats__rename_nochanges_no_find(void)
...
@@ -254,7 +254,7 @@ void test_diff_stats__rename_nochanges_no_find(void)
git_buf_free
(
&
buf
);
git_buf_free
(
&
buf
);
}
}
void
test_diff_stats__rename_and_modif
i
y_no_find
(
void
)
void
test_diff_stats__rename_and_modify_no_find
(
void
)
{
{
git_buf
buf
=
GIT_BUF_INIT
;
git_buf
buf
=
GIT_BUF_INIT
;
const
char
*
stat
=
const
char
*
stat
=
...
...
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