Skip to content

Commit

Permalink
Merge 273b199 into 1f6e742
Browse files Browse the repository at this point in the history
  • Loading branch information
mih committed Apr 12, 2018
2 parents 1f6e742 + 273b199 commit d40cd12
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datalad/distribution/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __call__(
ap['type'] = 'dataset'
if recursive and \
(ap.get('raw_input', False) or
ap.get('state', None) in ('modified', 'untracked')) and \
ap.get('state', None) in ('added', 'modified', 'untracked')) and \
(ap.get('parentds', None) or ap.get('type', None) == 'dataset'):
# this was an actually requested input path, or a path that was found
# modified by path annotation, based on an input argument
Expand Down
20 changes: 20 additions & 0 deletions datalad/distribution/tests/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ def test_add_files(path):
ok_(unstaged.isdisjoint(indexed))


@with_tempfile(mkdir=True)
def test_update_known_submodule(path):
def get_baseline(p):
ds = Dataset(p).create()
sub = ds.create('sub', save=False)
# subdataset saw another commit after becoming a submodule
ok_clean_git(ds.path, index_modified=['sub'])
return ds
# attempt one
ds = get_baseline(opj(path, 'wo_ref'))
with chpwd(ds.path):
add('.', recursive=True)
ok_clean_git(ds.path)

# attempt two, same as above but call add via reference dataset
ds = get_baseline(opj(path, 'w_ref'))
ds.add('.', recursive=True)
ok_clean_git(ds.path)


@with_tempfile(mkdir=True)
@known_failure_direct_mode #FIXME
def test_add_recursive(path):
Expand Down

0 comments on commit d40cd12

Please sign in to comment.