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
c1485330
Commit
c1485330
authored
May 09, 2016
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3767 from pks-t/pks/misc-fixes
Misc fixes
parents
6f02f198
fe3057b4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
23 deletions
+21
-23
src/checkout.c
+4
-2
src/delta-apply.c
+5
-5
src/diff.c
+6
-10
src/index.c
+1
-1
src/merge_file.c
+4
-4
src/odb_loose.c
+1
-1
No files found.
src/checkout.c
View file @
c1485330
...
@@ -1360,9 +1360,11 @@ fail:
...
@@ -1360,9 +1360,11 @@ fail:
static
bool
should_remove_existing
(
checkout_data
*
data
)
static
bool
should_remove_existing
(
checkout_data
*
data
)
{
{
int
ignorecase
=
0
;
int
ignorecase
;
git_repository__cvar
(
&
ignorecase
,
data
->
repo
,
GIT_CVAR_IGNORECASE
);
if
(
git_repository__cvar
(
&
ignorecase
,
data
->
repo
,
GIT_CVAR_IGNORECASE
)
<
0
)
{
ignorecase
=
0
;
}
return
(
ignorecase
&&
return
(
ignorecase
&&
(
data
->
strategy
&
GIT_CHECKOUT_DONT_REMOVE_EXISTING
)
==
0
);
(
data
->
strategy
&
GIT_CHECKOUT_DONT_REMOVE_EXISTING
)
==
0
);
...
...
src/delta-apply.c
View file @
c1485330
...
@@ -121,13 +121,13 @@ int git__delta_apply(
...
@@ -121,13 +121,13 @@ int git__delta_apply(
size_t
off
=
0
,
len
=
0
;
size_t
off
=
0
,
len
=
0
;
if
(
cmd
&
0x01
)
off
=
*
delta
++
;
if
(
cmd
&
0x01
)
off
=
*
delta
++
;
if
(
cmd
&
0x02
)
off
|=
*
delta
++
<<
8
;
if
(
cmd
&
0x02
)
off
|=
*
delta
++
<<
8
UL
;
if
(
cmd
&
0x04
)
off
|=
*
delta
++
<<
16
;
if
(
cmd
&
0x04
)
off
|=
*
delta
++
<<
16
UL
;
if
(
cmd
&
0x08
)
off
|=
*
delta
++
<<
24
;
if
(
cmd
&
0x08
)
off
|=
*
delta
++
<<
24
UL
;
if
(
cmd
&
0x10
)
len
=
*
delta
++
;
if
(
cmd
&
0x10
)
len
=
*
delta
++
;
if
(
cmd
&
0x20
)
len
|=
*
delta
++
<<
8
;
if
(
cmd
&
0x20
)
len
|=
*
delta
++
<<
8
UL
;
if
(
cmd
&
0x40
)
len
|=
*
delta
++
<<
16
;
if
(
cmd
&
0x40
)
len
|=
*
delta
++
<<
16
UL
;
if
(
!
len
)
len
=
0x10000
;
if
(
!
len
)
len
=
0x10000
;
if
(
base_len
<
off
+
len
||
res_sz
<
len
)
if
(
base_len
<
off
+
len
||
res_sz
<
len
)
...
...
src/diff.c
View file @
c1485330
...
@@ -1083,17 +1083,13 @@ static int handle_unmatched_new_item(
...
@@ -1083,17 +1083,13 @@ static int handle_unmatched_new_item(
if
(
recurse_into_dir
)
{
if
(
recurse_into_dir
)
{
error
=
iterator_advance_into
(
&
info
->
nitem
,
info
->
new_iter
);
error
=
iterator_advance_into
(
&
info
->
nitem
,
info
->
new_iter
);
/* if real error or no error, proceed with iteration */
/* if directory is empty, can't advance into it, so skip it */
if
(
error
!=
GIT_ENOTFOUND
)
if
(
error
==
GIT_ENOTFOUND
)
{
return
error
;
giterr_clear
();
giterr_clear
();
error
=
iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
}
/* if directory is empty, can't advance into it, so either skip
return
error
;
* it or ignore it
*/
if
(
error
==
GIT_ENOTFOUND
||
contains_oitem
)
return
iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
delta_type
=
GIT_DELTA_IGNORED
;
}
}
}
}
...
...
src/index.c
View file @
c1485330
...
@@ -3008,7 +3008,7 @@ int git_index_read_index(
...
@@ -3008,7 +3008,7 @@ int git_index_read_index(
if
(
error
<
0
)
{
if
(
error
<
0
)
{
giterr_set
(
GITERR_INDEX
,
"failed to insert entry"
);
giterr_set
(
GITERR_INDEX
,
"failed to insert entry"
);
return
error
;
goto
done
;
}
}
if
(
diff
<=
0
)
{
if
(
diff
<=
0
)
{
...
...
src/merge_file.c
View file @
c1485330
...
@@ -134,8 +134,8 @@ static int merge_file__xdiff(
...
@@ -134,8 +134,8 @@ static int merge_file__xdiff(
path
=
git_merge_file__best_path
(
path
=
git_merge_file__best_path
(
ancestor
?
ancestor
->
path
:
NULL
,
ancestor
?
ancestor
->
path
:
NULL
,
ours
?
ours
->
path
:
NULL
,
ours
->
path
,
theirs
?
theirs
->
path
:
NULL
);
theirs
->
path
);
if
(
path
!=
NULL
&&
(
out
->
path
=
git__strdup
(
path
))
==
NULL
)
{
if
(
path
!=
NULL
&&
(
out
->
path
=
git__strdup
(
path
))
==
NULL
)
{
error
=
-
1
;
error
=
-
1
;
...
@@ -147,8 +147,8 @@ static int merge_file__xdiff(
...
@@ -147,8 +147,8 @@ static int merge_file__xdiff(
out
->
len
=
mmbuffer
.
size
;
out
->
len
=
mmbuffer
.
size
;
out
->
mode
=
git_merge_file__best_mode
(
out
->
mode
=
git_merge_file__best_mode
(
ancestor
?
ancestor
->
mode
:
0
,
ancestor
?
ancestor
->
mode
:
0
,
ours
?
ours
->
mode
:
0
,
ours
->
mode
,
theirs
?
theirs
->
mode
:
0
);
theirs
->
mode
);
done:
done:
if
(
error
<
0
)
if
(
error
<
0
)
...
...
src/odb_loose.c
View file @
c1485330
...
@@ -91,7 +91,7 @@ static int object_mkdir(const git_buf *name, const loose_backend *be)
...
@@ -91,7 +91,7 @@ static int object_mkdir(const git_buf *name, const loose_backend *be)
static
size_t
get_binary_object_header
(
obj_hdr
*
hdr
,
git_buf
*
obj
)
static
size_t
get_binary_object_header
(
obj_hdr
*
hdr
,
git_buf
*
obj
)
{
{
unsigned
char
c
;
unsigned
long
c
;
unsigned
char
*
data
=
(
unsigned
char
*
)
obj
->
ptr
;
unsigned
char
*
data
=
(
unsigned
char
*
)
obj
->
ptr
;
size_t
shift
,
size
,
used
=
0
;
size_t
shift
,
size
,
used
=
0
;
...
...
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