Merge lp:~jelmer/brz/git-submodule-not-checked-out into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/git-submodule-not-checked-out
Merge into: lp:brz
Diff against target: 67 lines (+19/-13)
3 files modified
breezy/git/tests/test_workingtree.py (+12/-0)
breezy/git/tree.py (+6/-12)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~jelmer/brz/git-submodule-not-checked-out
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+377807@code.launchpad.net

Commit message

Don't show submodules that are not checked out as deltas.

Description of the change

Don't show submodules that are not checked out as deltas.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/git/tests/test_workingtree.py'
--- breezy/git/tests/test_workingtree.py 2019-09-21 17:08:09 +0000
+++ breezy/git/tests/test_workingtree.py 2020-01-19 15:24:53 +0000
@@ -275,3 +275,15 @@
275 t.add(b"a", S_IFGITLINK, a.id)275 t.add(b"a", S_IFGITLINK, a.id)
276 self.store.add_object(t)276 self.store.add_object(t)
277 self.expectDelta([], tree_id=t.id)277 self.expectDelta([], tree_id=t.id)
278
279 def test_submodule_not_checked_out(self):
280 a = Blob.from_string(b'irrelevant\n')
281 with self.wt.lock_tree_write():
282 (index, index_path) = self.wt._lookup_index(b'a')
283 index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0)
284 self.wt._index_dirty = True
285 os.mkdir(self.wt.abspath('a'))
286 t = Tree()
287 t.add(b"a", S_IFGITLINK, a.id)
288 self.store.add_object(t)
289 self.expectDelta([], tree_id=t.id)
278290
=== modified file 'breezy/git/tree.py'
--- breezy/git/tree.py 2020-01-11 04:11:04 +0000
+++ breezy/git/tree.py 2020-01-19 15:24:53 +0000
@@ -1603,24 +1603,18 @@
1603 if e.errno == errno.ENOENT:1603 if e.errno == errno.ENOENT:
1604 # Entry was removed; keep it listed, but mark it as gone.1604 # Entry was removed; keep it listed, but mark it as gone.
1605 blobs[path] = (ZERO_SHA, 0)1605 blobs[path] = (ZERO_SHA, 0)
1606 elif e.errno == errno.EISDIR:1606 else:
1607 # Backwards compatibility with Dulwich < 0.19.12;1607 raise
1608 # newer versions of Dulwich return either an entry for the1608 else:
1609 # submodule or None for directories.1609 if live_entry is None:
1610 # Entry was turned into a directory.
1611 # Maybe it's just a submodule that's not checked out?
1610 if S_ISGITLINK(index_entry.mode):1612 if S_ISGITLINK(index_entry.mode):
1611 blobs[path] = (index_entry.sha, index_entry.mode)1613 blobs[path] = (index_entry.sha, index_entry.mode)
1612 else:1614 else:
1613 # Entry was turned into a directory
1614 dirified.append((path, Tree().id, stat.S_IFDIR))1615 dirified.append((path, Tree().id, stat.S_IFDIR))
1615 store.add_object(Tree())1616 store.add_object(Tree())
1616 else:1617 else:
1617 raise
1618 else:
1619 if live_entry is None:
1620 # Entry was turned into a directory
1621 dirified.append((path, Tree().id, stat.S_IFDIR))
1622 store.add_object(Tree())
1623 else:
1624 mode = live_entry.mode1618 mode = live_entry.mode
1625 if not trust_executable:1619 if not trust_executable:
1626 if mode_is_executable(index_entry.mode):1620 if mode_is_executable(index_entry.mode):
16271621
=== modified file 'setup.py'
--- setup.py 2019-06-02 05:13:10 +0000
+++ setup.py 2020-01-19 15:24:53 +0000
@@ -69,7 +69,7 @@
69 # Technically, Breezy works without these two dependencies too. But there's69 # Technically, Breezy works without these two dependencies too. But there's
70 # no way to enable them by default and let users opt out.70 # no way to enable them by default and let users opt out.
71 'fastimport>=0.9.8',71 'fastimport>=0.9.8',
72 'dulwich>=0.19.11',72 'dulwich>=0.19.12',
73 ],73 ],
74 'extras_require': {74 'extras_require': {
75 'fastimport': [],75 'fastimport': [],

Subscribers

People subscribed via source and target branches