Skip to content

Commit

Permalink
BF: Record the state of the corresponding branch in a superdataset
Browse files Browse the repository at this point in the history
This ensures that superdatasets saved on crippled FS do not reference
commits in managed branches.
  • Loading branch information
mih committed Dec 17, 2020
1 parent 66f439a commit ca57e81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datalad/support/gitrepo.py
Expand Up @@ -4188,7 +4188,10 @@ def _save_add_submodules(self, paths):
for path in paths:
rpath = str(path.relative_to(self.pathobj).as_posix())
subm = repo_from_path(path)
subm_commit = subm.get_hexsha()
# if there is a corresponding branch, we want to record it's state.
# we rely on the corresponding branch being synced already.
# `save` should do that each time it runs.
subm_commit = subm.get_hexsha(subm.get_corresponding_branch())
if not subm_commit:
yield get_status_dict(
action='add_submodule',
Expand Down

0 comments on commit ca57e81

Please sign in to comment.