Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master, master-1, and master-0

Always finish writing to disk before calculating checksum.

Changeset ad38ef205d7b

Parent 514f6627b6f8

by Jelmer Vernooij

Changes to 2 files · Browse files at ad38ef205d7b Showing diff from parent 514f6627b6f8 Diff from another changeset...

Change 1 of 1 Show Entire File NEWS Stacked
 
7
8
9
 
 
10
11
12
 
7
8
9
10
11
12
13
14
@@ -7,6 +7,8 @@
  * Don't fetch ^{} objects from remote hosts, as requesting them   causes a hangup.   + * Always write pack to disk completely before calculating checksum. +   FEATURES     * Allow disabling thin packs when talking to remote hosts.
 
96
97
98
99
 
100
101
102
 
152
153
154
 
 
155
156
157
 
165
166
167
 
 
168
169
170
 
96
97
98
 
99
100
101
102
 
152
153
154
155
156
157
158
159
 
167
168
169
170
171
172
173
174
@@ -96,7 +96,7 @@
  for pack in self.packs:   if sha in pack:   return pack.get_raw(sha, self.get_raw) - # FIXME: Are pack deltas ever against on-disk shafiles ? + # FIXME: Are thin pack deltas ever against on-disk shafiles ?   ret = self._get_shafile(sha)   if ret is not None:   return ret.as_raw_string() @@ -152,6 +152,8 @@
  fd, path = tempfile.mkstemp(dir=self.pack_dir(), suffix=".pack")   f = os.fdopen(fd, 'w')   def commit(): + os.fdatasync(fd) + f.close()   if os.path.getsize(path) > 0:   self.move_in_thin_pack(path)   return f, commit @@ -165,6 +167,8 @@
  fd, path = tempfile.mkstemp(dir=self.pack_dir(), suffix=".pack")   f = os.fdopen(fd, 'w')   def commit(): + os.fdatasync(fd) + f.close()   if os.path.getsize(path) > 0:   self.move_in_pack(path)   return f, commit