Repository: iterative/dvc

Issue:
Dvc add data unprotect files for each use
My DVC version 
![image](https://user-images.githubusercontent.com/20395242/59399222-dac61880-8dc5-11e9-88db-c5fc4e232d56.png)

This issue comes from **Share NAS data in serve**r in the [discuss post 11#](https://discuss.dvc.org/t/share-nas-data-in-server/180/11?u=jimmy15923)

When adding new data, dvc will unprotect all data which cost lots of time (about 20 mins) which seems inevitable.

![image](https://user-images.githubusercontent.com/20395242/59399331-2aa4df80-8dc6-11e9-9aa2-f0c2ef9d4b01.png)


Discussion:

Patch:
diff --git a/dvc/stage.py b/dvc/stage.py
index 142e94094..cc91c81e0 100644
--- a/dvc/stage.py
+++ b/dvc/stage.py
@@ -505,8 +505,6 @@ class Stage(object):
             stage.remove_outs(ignore_remove=False)
             logger.warning("Build cache is ignored when using --remove-outs.")
             ignore_build_cache = True
-        else:
-            stage.unprotect_outs()
 
         if os.path.exists(path) and any(out.persist for out in stage.outs):
             logger.warning("Build cache is ignored when persisting outputs.")


Test patch:
diff --git a/tests/func/test_add.py b/tests/func/test_add.py
index a9c52185c..6e7516c49 100644
--- a/tests/func/test_add.py
+++ b/tests/func/test_add.py
@@ -12,6 +12,7 @@ import posixpath
 import logging
 import colorama
 
+from dvc.remote import RemoteLOCAL
 from dvc.system import System
 from mock import patch
 
@@ -535,3 +536,20 @@ def test_windows_should_add_when_cache_on_different_drive(
 
     ret = main(["add", repo_dir.DATA])
     assert ret == 0
+
+
+def test_readding_dir_should_not_unprotect_all(dvc_repo, repo_dir):
+    dvc_repo.cache.local.cache_types = ["symlink"]
+    dvc_repo.cache.local.protected = True
+
+    dvc_repo.add(repo_dir.DATA_DIR)
+    new_file = os.path.join(repo_dir.DATA_DIR, "new_file")
+
+    repo_dir.create(new_file, "new_content")
+
+    unprotect_spy = spy(RemoteLOCAL.unprotect)
+    with patch.object(RemoteLOCAL, "unprotect", unprotect_spy):
+        dvc_repo.add(repo_dir.DATA_DIR)
+
+    assert not unprotect_spy.mock.called
+    assert System.is_symlink(new_file)