Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
submodule_move_head: reuse child_process structure for futher commands
author
Stefan Beller
<sbeller@google.com>
Tue, 2 May 2017 19:32:12 +0000
(12:32 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 4 May 2017 04:42:04 +0000
(13:42 +0900)
We do not need to declare another struct child_process, but we can just
reuse the existing `cp` struct.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (from parent 1:
d2bbb7c
)
diff --git
a/submodule.c
b/submodule.c
index d3299e29c0855b8503f444f659e2b24bba8ecb1f..a2377ce019a39dcd0fc9aa05f1282f44f48ddbea 100644
(file)
--- a/
submodule.c
+++ b/
submodule.c
@@
-1468,15
+1468,15
@@
int submodule_move_head(const char *path,
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
if (new) {
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
if (new) {
-
struct child_process cp1 = CHILD_PROCESS_INIT
;
+
child_process_init(&cp)
;
/* also set the HEAD accordingly */
/* also set the HEAD accordingly */
- cp
1
.git_cmd = 1;
- cp
1
.no_stdin = 1;
- cp
1
.dir = path;
+ cp.git_cmd = 1;
+ cp.no_stdin = 1;
+ cp.dir = path;
- argv_array_pushl(&cp
1
.args, "update-ref", "HEAD", new, NULL);
+ argv_array_pushl(&cp.args, "update-ref", "HEAD", new, NULL);
- if (run_command(&cp
1
)) {
+ if (run_command(&cp)) {
ret = -1;
goto out;
}
ret = -1;
goto out;
}