/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff-delta.c

  • Committer: Martin
  • Date: 2011-03-04 19:50:59 UTC
  • mto: This revision was merged to the branch mainline in revision 5731.
  • Revision ID: gzlist@googlemail.com-20110304195059-7pv73zppcklo80ol
Change create_delta_index_from_delta too so NULL can be treated as MemoryError

Show diffs side-by-side

added added

removed removed

Lines of Context:
690
690
    struct delta_index *new_index;
691
691
    struct index_entry *entry, *entries;
692
692
 
 
693
    assert(old_index != NULL);
693
694
    if (!src->buf || !src->size)
694
695
        return NULL;
695
696
    buffer = src->buf;
773
774
            break;
774
775
        }
775
776
    }
 
777
    /* GZ 2011-03-04: What is 'something' exactly? If this an unrecoverable
 
778
                      error perhaps it should be an assert? */
776
779
    if (data != top) {
777
780
        /* Something was wrong with this delta */
778
781
        free(entries);
779
 
        return NULL;
 
782
        return old_index;
780
783
    }
781
784
    if (num_entries == 0) {
782
785
        /** Nothing to index **/
783
786
        free(entries);
784
 
        return NULL;
 
787
        return old_index;
785
788
    }
786
 
    assert(old_index != NULL);
787
789
    old_index->last_src = src;
788
790
    /* See if we can fill in these values into the holes in the array */
789
791
    entry = entries;
841
843
        new_index = create_index_from_old_and_new_entries(old_index,
842
844
            entry, num_entries);
843
845
    } else {
844
 
        new_index = NULL;
 
846
        new_index = old_index;
845
847
        // fprintf(stderr, "inserted %d without resizing\n", num_inserted);
846
848
    }
847
849
    free(entries);