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
9cf0f287
Commit
9cf0f287
authored
Aug 04, 2011
by
Carlos Martín Nieto
Committed by
Vicent Marti
Aug 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tell the user where the downloaded packfile is stored
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent
e1d88030
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
src/fetch.c
+2
-2
src/transport.c
+2
-2
src/transport.h
+2
-2
src/transport_git.c
+8
-4
No files found.
src/fetch.c
View file @
9cf0f287
...
...
@@ -199,7 +199,7 @@ cleanup:
return
error
;
}
int
git_fetch_download_pack
(
git_remote
*
remote
)
int
git_fetch_download_pack
(
char
**
out
,
git_remote
*
remote
)
{
return
git_transport_download_pack
(
remote
->
transport
,
remote
->
repo
);
return
git_transport_download_pack
(
out
,
remote
->
transport
,
remote
->
repo
);
}
src/transport.c
View file @
9cf0f287
...
...
@@ -100,9 +100,9 @@ int git_transport_send_done(struct git_transport *transport)
return
transport
->
send_done
(
transport
);
}
int
git_transport_download_pack
(
git_transport
*
transport
,
git_repository
*
repo
)
int
git_transport_download_pack
(
char
**
out
,
git_transport
*
transport
,
git_repository
*
repo
)
{
return
transport
->
download_pack
(
transport
,
repo
);
return
transport
->
download_pack
(
out
,
transport
,
repo
);
}
int
git_transport_close
(
git_transport
*
transport
)
...
...
src/transport.h
View file @
9cf0f287
...
...
@@ -75,7 +75,7 @@ struct git_transport {
/**
* Download the packfile
*/
int
(
*
download_pack
)(
struct
git_transport
*
transport
,
git_repository
*
repo
);
int
(
*
download_pack
)(
char
**
out
,
struct
git_transport
*
transport
,
git_repository
*
repo
);
/**
* Fetch the changes
*/
...
...
@@ -98,6 +98,6 @@ int git_transport_send_wants(struct git_transport *transport, git_headarray *arr
int
git_transport_send_have
(
struct
git_transport
*
transport
,
git_oid
*
oid
);
int
git_transport_send_done
(
struct
git_transport
*
transport
);
int
git_transport_send_flush
(
struct
git_transport
*
transport
);
int
git_transport_download_pack
(
git_transport
*
transport
,
git_repository
*
repo
);
int
git_transport_download_pack
(
char
**
out
,
git_transport
*
transport
,
git_repository
*
repo
);
#endif
src/transport_git.c
View file @
9cf0f287
...
...
@@ -304,11 +304,11 @@ static int git_send_done(git_transport *transport)
return
git_pkt_send_done
(
t
->
socket
);
}
static
int
store_pack
(
gitno_buffer
*
buf
,
git_repository
*
repo
)
static
int
store_pack
(
char
**
out
,
gitno_buffer
*
buf
,
git_repository
*
repo
)
{
git_filebuf
file
;
int
error
;
char
path
[
GIT_PATH_MAX
],
suff
[]
=
"/objects/pack/pack-
XXXX.pack
\0
"
;
char
path
[
GIT_PATH_MAX
],
suff
[]
=
"/objects/pack/pack-
received
\0
"
;
off_t
off
=
0
;
memcpy
(
path
,
repo
->
path_repository
,
GIT_PATH_MAX
-
off
);
...
...
@@ -330,13 +330,17 @@ static int store_pack(gitno_buffer *buf, git_repository *repo)
gitno_consume_n
(
buf
,
buf
->
offset
);
}
*
out
=
git__strdup
(
file
.
path_lock
);
if
(
*
out
==
NULL
)
error
=
GIT_ENOMEM
;
cleanup:
if
(
error
<
GIT_SUCCESS
)
git_filebuf_cleanup
(
&
file
);
return
error
;
}
static
int
git_download_pack
(
git_transport
*
transport
,
git_repository
*
repo
)
static
int
git_download_pack
(
char
**
out
,
git_transport
*
transport
,
git_repository
*
repo
)
{
transport_git
*
t
=
(
transport_git
*
)
transport
;
int
s
=
t
->
socket
,
error
=
GIT_SUCCESS
,
pack
=
0
;
...
...
@@ -379,7 +383,7 @@ static int git_download_pack(git_transport *transport, git_repository *repo)
* into a packfile
*/
return
store_pack
(
&
buf
,
repo
);
return
store_pack
(
out
,
&
buf
,
repo
);
}
return
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