This seems like a caching issue. You had all the files in Y, but then they were deleted in X. For some reason, adding and deleting files tends to do strange things like this.
, ,
git rm --cached <file>
script, , , , , Y ( ):
diff = `git diff --name-status X`
diff = diff.split
deleted_files = diff.map do |entry|
status_name_pair = entry.split('\t')
return status_name_pair.last if status_name_pair.first == 'D'
end
deleted_files.each do |filename|
`git rm --cached #{filename}`
end
, :
git rm --cached <dir>