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
1=== modified file 'breezy/git/tests/test_workingtree.py'
2--- breezy/git/tests/test_workingtree.py 2019-09-21 17:08:09 +0000
3+++ breezy/git/tests/test_workingtree.py 2020-01-19 15:24:53 +0000
4@@ -275,3 +275,15 @@
5 t.add(b"a", S_IFGITLINK, a.id)
6 self.store.add_object(t)
7 self.expectDelta([], tree_id=t.id)
8+
9+ def test_submodule_not_checked_out(self):
10+ a = Blob.from_string(b'irrelevant\n')
11+ with self.wt.lock_tree_write():
12+ (index, index_path) = self.wt._lookup_index(b'a')
13+ index[b'a'] = IndexEntry(0, 0, 0, 0, S_IFGITLINK, 0, 0, 0, a.id, 0)
14+ self.wt._index_dirty = True
15+ os.mkdir(self.wt.abspath('a'))
16+ t = Tree()
17+ t.add(b"a", S_IFGITLINK, a.id)
18+ self.store.add_object(t)
19+ self.expectDelta([], tree_id=t.id)
20
21=== modified file 'breezy/git/tree.py'
22--- breezy/git/tree.py 2020-01-11 04:11:04 +0000
23+++ breezy/git/tree.py 2020-01-19 15:24:53 +0000
24@@ -1603,24 +1603,18 @@
25 if e.errno == errno.ENOENT:
26 # Entry was removed; keep it listed, but mark it as gone.
27 blobs[path] = (ZERO_SHA, 0)
28- elif e.errno == errno.EISDIR:
29- # Backwards compatibility with Dulwich < 0.19.12;
30- # newer versions of Dulwich return either an entry for the
31- # submodule or None for directories.
32+ else:
33+ raise
34+ else:
35+ if live_entry is None:
36+ # Entry was turned into a directory.
37+ # Maybe it's just a submodule that's not checked out?
38 if S_ISGITLINK(index_entry.mode):
39 blobs[path] = (index_entry.sha, index_entry.mode)
40 else:
41- # Entry was turned into a directory
42 dirified.append((path, Tree().id, stat.S_IFDIR))
43 store.add_object(Tree())
44 else:
45- raise
46- else:
47- if live_entry is None:
48- # Entry was turned into a directory
49- dirified.append((path, Tree().id, stat.S_IFDIR))
50- store.add_object(Tree())
51- else:
52 mode = live_entry.mode
53 if not trust_executable:
54 if mode_is_executable(index_entry.mode):
55
56=== modified file 'setup.py'
57--- setup.py 2019-06-02 05:13:10 +0000
58+++ setup.py 2020-01-19 15:24:53 +0000
59@@ -69,7 +69,7 @@
60 # Technically, Breezy works without these two dependencies too. But there's
61 # no way to enable them by default and let users opt out.
62 'fastimport>=0.9.8',
63- 'dulwich>=0.19.11',
64+ 'dulwich>=0.19.12',
65 ],
66 'extras_require': {
67 'fastimport': [],

Subscribers

People subscribed via source and target branches