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
53f51c60
Unverified
Commit
53f51c60
authored
Aug 21, 2019
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smart: implement by-date insertion when revwalking
parent
4b91f058
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
src/revwalk.c
+3
-1
src/revwalk.h
+1
-0
src/transports/smart_protocol.c
+4
-1
No files found.
src/revwalk.c
View file @
53f51c60
...
@@ -83,7 +83,9 @@ int git_revwalk__push_commit(git_revwalk *walk, const git_oid *oid, const git_re
...
@@ -83,7 +83,9 @@ int git_revwalk__push_commit(git_revwalk *walk, const git_oid *oid, const git_re
commit
->
uninteresting
=
opts
->
uninteresting
;
commit
->
uninteresting
=
opts
->
uninteresting
;
list
=
walk
->
user_input
;
list
=
walk
->
user_input
;
if
(
git_commit_list_insert
(
commit
,
&
list
)
==
NULL
)
{
if
((
opts
->
insert_by_date
&&
git_commit_list_insert_by_date
(
commit
,
&
list
)
==
NULL
)
||
git_commit_list_insert
(
commit
,
&
list
)
==
NULL
)
{
git_error_set_oom
();
git_error_set_oom
();
return
-
1
;
return
-
1
;
}
}
...
...
src/revwalk.h
View file @
53f51c60
...
@@ -53,6 +53,7 @@ git_commit_list_node *git_revwalk__commit_lookup(git_revwalk *walk, const git_oi
...
@@ -53,6 +53,7 @@ git_commit_list_node *git_revwalk__commit_lookup(git_revwalk *walk, const git_oi
typedef
struct
{
typedef
struct
{
int
uninteresting
;
int
uninteresting
;
int
from_glob
;
int
from_glob
;
int
insert_by_date
;
}
git_revwalk__push_options
;
}
git_revwalk__push_options
;
#define GIT_REVWALK__PUSH_OPTIONS_INIT { 0 }
#define GIT_REVWALK__PUSH_OPTIONS_INIT { 0 }
...
...
src/transports/smart_protocol.c
View file @
53f51c60
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "pack-objects.h"
#include "pack-objects.h"
#include "remote.h"
#include "remote.h"
#include "util.h"
#include "util.h"
#include "revwalk.h"
#define NETWORK_XFER_THRESHOLD (100*1024)
#define NETWORK_XFER_THRESHOLD (100*1024)
/* The minimal interval between progress updates (in seconds). */
/* The minimal interval between progress updates (in seconds). */
...
@@ -303,6 +304,7 @@ static int wait_while_ack(gitno_buffer *buf)
...
@@ -303,6 +304,7 @@ static int wait_while_ack(gitno_buffer *buf)
int
git_smart__negotiate_fetch
(
git_transport
*
transport
,
git_repository
*
repo
,
const
git_remote_head
*
const
*
wants
,
size_t
count
)
int
git_smart__negotiate_fetch
(
git_transport
*
transport
,
git_repository
*
repo
,
const
git_remote_head
*
const
*
wants
,
size_t
count
)
{
{
transport_smart
*
t
=
(
transport_smart
*
)
transport
;
transport_smart
*
t
=
(
transport_smart
*
)
transport
;
git_revwalk__push_options
opts
=
GIT_REVWALK__PUSH_OPTIONS_INIT
;
gitno_buffer
*
buf
=
&
t
->
buffer
;
gitno_buffer
*
buf
=
&
t
->
buffer
;
git_buf
data
=
GIT_BUF_INIT
;
git_buf
data
=
GIT_BUF_INIT
;
git_revwalk
*
walk
=
NULL
;
git_revwalk
*
walk
=
NULL
;
...
@@ -317,7 +319,8 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
...
@@ -317,7 +319,8 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
if
((
error
=
git_revwalk_new
(
&
walk
,
repo
))
<
0
)
if
((
error
=
git_revwalk_new
(
&
walk
,
repo
))
<
0
)
goto
on_error
;
goto
on_error
;
if
((
error
=
git_revwalk_push_glob
(
walk
,
"refs/*"
))
<
0
)
opts
.
insert_by_date
=
1
;
if
((
error
=
git_revwalk__push_glob
(
walk
,
"refs/*"
,
&
opts
))
<
0
)
goto
on_error
;
goto
on_error
;
/*
/*
...
...
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