tree schema BUGFIX augments may cause transitive dependencies

Fixes #1795
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index e5953fc..42aa112 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -2243,19 +2243,34 @@
 }
 
 ly_bool
-lys_has_groupings(const struct lys_module *mod)
+lys_has_dep_mods(const struct lys_module *mod)
 {
     LY_ARRAY_COUNT_TYPE u;
 
-    if (mod->parsed->groupings) {
+    /* features */
+    if (mod->parsed->features) {
         return 1;
     }
 
+    /* groupings */
+    if (mod->parsed->groupings) {
+        return 1;
+    }
     LY_ARRAY_FOR(mod->parsed->includes, u) {
         if (mod->parsed->includes[u].submodule->groupings) {
             return 1;
         }
     }
 
+    /* augments (adding nodes with leafrefs) */
+    if (mod->parsed->augments) {
+        return 1;
+    }
+    LY_ARRAY_FOR(mod->parsed->includes, u) {
+        if (mod->parsed->includes[u].submodule->augments) {
+            return 1;
+        }
+    }
+
     return 0;
 }