Show More
@@ -261,7 +261,7 b' static PyObject *dirstate_unset;' | |||
|
261 | 261 | static PyObject *pack_dirstate(PyObject *self, PyObject *args) |
|
262 | 262 | { |
|
263 | 263 | PyObject *packobj = NULL; |
|
264 | PyObject *map, *copymap, *pl; | |
|
264 | PyObject *map, *copymap, *pl, *mtime_unset = NULL; | |
|
265 | 265 | Py_ssize_t nbytes, pos, l; |
|
266 | 266 | PyObject *k, *v, *pn; |
|
267 | 267 | char *p, *s; |
@@ -342,9 +342,15 b' static PyObject *pack_dirstate(PyObject ' | |||
|
342 | 342 | if (*s == 'n' && mtime == (uint32_t)now) { |
|
343 | 343 | /* See pure/parsers.py:pack_dirstate for why we do |
|
344 | 344 | * this. */ |
|
345 | if (PyDict_SetItem(map, k, dirstate_unset) == -1) | |
|
345 | mtime = -1; | |
|
346 | mtime_unset = Py_BuildValue( | |
|
347 | "ciii", *s, mode, size, mtime); | |
|
348 | if (!mtime_unset) | |
|
346 | 349 | goto bail; |
|
347 | mtime = -1; | |
|
350 | if (PyDict_SetItem(map, k, mtime_unset) == -1) | |
|
351 | goto bail; | |
|
352 | Py_DECREF(mtime_unset); | |
|
353 | mtime_unset = NULL; | |
|
348 | 354 | } |
|
349 | 355 | putbe32(mode, p); |
|
350 | 356 | putbe32(size, p + 4); |
@@ -374,6 +380,7 b' static PyObject *pack_dirstate(PyObject ' | |||
|
374 | 380 | |
|
375 | 381 | return packobj; |
|
376 | 382 | bail: |
|
383 | Py_XDECREF(mtime_unset); | |
|
377 | 384 | Py_XDECREF(packobj); |
|
378 | 385 | return NULL; |
|
379 | 386 | } |
General Comments 0
You need to be logged in to leave comments.
Login now