瀏覽代碼

Don't close file twice.

Jelmer Vernooij 16 年之前
父節點
當前提交
714631cfc2
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      bin/dulwich

+ 3 - 8
bin/dulwich

@@ -166,14 +166,9 @@ def cmd_clone(args):
 	r = Repo(path)
 	graphwalker = SimpleFetchGraphWalker(r.heads().values(), r.get_parents)
 	f, commit = r.object_store.add_pack()
-	try:
-		client.fetch_pack(host_path, r.object_store.determine_wants_all, graphwalker, f.write, 
-				          sys.stdout.write)
-		f.close()
-		commit()
-	except:
-		f.close()
-		raise
+	client.fetch_pack(host_path, r.object_store.determine_wants_all, 
+			          graphwalker, f.write, sys.stdout.write)
+	commit()
 
 
 commands = {