summaryrefslogtreecommitdiff
path: root/builtin-fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 11:55:32 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 11:55:32 -0800
commitf79ff5c975499089b03904a6619923683262bf22 (patch)
tree06d71decd7e4198f37687b5f604de9149904ce8c /builtin-fetch-pack.c
parent860cc3a4f9c3ac21fcd37bbe30f40ab073f01299 (diff)
parentc20181e3a3e39f2c8874567c219e9edddb84393a (diff)
downloadgit-f79ff5c975499089b03904a6619923683262bf22.tar.gz
Merge branch 'js/run-command'
* js/run-command: start_command(), if .in/.out > 0, closes file descriptors, not the callers start_command(), .in/.out/.err = -1: Callers must close the file descriptor
Diffstat (limited to 'builtin-fetch-pack.c')
-rw-r--r--builtin-fetch-pack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index f40135248a..5ea48ca7db 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -538,8 +538,10 @@ static int get_pack(int xd[2], char **pack_lockfile)
cmd.git_cmd = 1;
if (start_command(&cmd))
die("fetch-pack: unable to fork off %s", argv[0]);
- if (do_keep && pack_lockfile)
+ if (do_keep && pack_lockfile) {
*pack_lockfile = index_pack_lockfile(cmd.out);
+ close(cmd.out);
+ }
if (finish_command(&cmd))
die("%s failed", argv[0]);