Dulwich.io dulwich / bf33f02
Rename submodule into subproject in diff to match CGit behavior When generating a diff in a repository with dirty submodules, CGit is using the subproject terminology. I couldn't find the reasoning why or since when it has been doing it but https://stackoverflow.com/q/4873980/2996250 seems to indicate it has been the case since 2011 at least. It has no real impacts as submodules information in diff are mostly ignored by `git apply` but this makes Dulwich behavior closer to CGit one. Boris Feld authored 1 year, 4 months ago Jelmer Vernooń≥ committed 8 months ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
197197 if hexsha is None:
198198 return Blob.from_string(b'')
199199 elif S_ISGITLINK(mode):
200 return Blob.from_string(b"Submodule commit " + hexsha + b"\n")
200 return Blob.from_string(b"Subproject commit " + hexsha + b"\n")
201201 else:
202202 return store[hexsha]
203203
363363 b'--- a/asubmodule',
364364 b'+++ b/asubmodule',
365365 b'@@ -1 +1 @@',
366 b'-Submodule commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4',
367 b'+Submodule commit cc975646af69f279396d4d5e1379ac6af80ee637',
366 b'-Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4',
367 b'+Subproject commit cc975646af69f279396d4d5e1379ac6af80ee637',
368368 ], f.getvalue().splitlines())
369369
370370 def test_object_diff_blob(self):
535535 b'@@ -1,2 +1 @@',
536536 b'-new',
537537 b'-same',
538 b'+Submodule commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4',
538 b'+Subproject commit 06d0bdd9e2e20377b3180e4986b14c8549b393e4',
539539 ], f.getvalue().splitlines())
540540
541541