~jelmer/brz/dulwich-compat

« back to all changes in this revision

Viewing changes to breezy/git/tests/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2021-05-24 22:47:03 UTC
  • Revision ID: jelmer@jelmer.uk-20210524224703-vcqjrv8ua4ltppg5
Fix dulwich compatibility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        self.build_tree(['conflicted'])
88
88
        self.tree.add(['conflicted'])
89
89
        with self.tree.lock_tree_write():
90
 
            self.tree.index[b'conflicted'] = self.tree.index[b'conflicted'][:9] + \
91
 
                (FLAG_STAGEMASK, )
 
90
            self.tree.index[b'conflicted'] = self.tree.index[b'conflicted']._replace(
 
91
                flags=FLAG_STAGEMASK)
92
92
            self.tree._index_dirty = True
93
93
        conflicts = self.tree.conflicts()
94
94
        self.assertEqual(1, len(conflicts))
360
360
        self.build_tree_contents([('a/.git/HEAD', a.id)])
361
361
        with self.wt.lock_tree_write():
362
362
            (index, index_path) = self.wt._lookup_index(b'a')
363
 
            index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0)
 
363
            index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0, 0)
364
364
            self.wt._index_dirty = True
365
365
        t = Tree()
366
366
        t.add(b"a", S_IFGITLINK, a.id)
371
371
        a = Blob.from_string(b'irrelevant\n')
372
372
        with self.wt.lock_tree_write():
373
373
            (index, index_path) = self.wt._lookup_index(b'a')
374
 
            index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0)
 
374
            index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0, 0)
375
375
            self.wt._index_dirty = True
376
376
        os.mkdir(self.wt.abspath('a'))
377
377
        t = Tree()