summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/data.c b/data.c
index 122021e..e98cca9 100644
--- a/data.c
+++ b/data.c
@@ -411,11 +411,18 @@ d_char *_object_fn(const char *id)
411} 411}
412 412
413 413
414int object_here_by_md5(char *id)
415/* checks if an object is already downloaded */
416{
417 xs *fn = _object_fn_by_md5(id);
418 return mtime(fn) > 0.0;
419}
420
421
414int object_here(char *id) 422int object_here(char *id)
415/* checks if an object is already downloaded */ 423/* checks if an object is already downloaded */
416{ 424{
417 xs *fn = _object_fn(id); 425 xs *fn = _object_fn(id);
418
419 return mtime(fn) > 0.0; 426 return mtime(fn) > 0.0;
420} 427}
421 428
@@ -818,10 +825,8 @@ d_char *timeline_top_level(d_char *list)
818 if (!object_parent(line, line2, sizeof(line2))) 825 if (!object_parent(line, line2, sizeof(line2)))
819 break; 826 break;
820 827
821 xs *pfn = _object_fn_by_md5(line2);
822
823 /* well, there is a parent... but if it's not there, use this */ 828 /* well, there is a parent... but if it's not there, use this */
824 if (mtime(pfn) == 0.0) 829 if (!object_here_by_md5(line2))
825 break; 830 break;
826 831
827 /* it's here! try again with its own parent */ 832 /* it's here! try again with its own parent */