Skip to content

Commit d8ca902

Browse files
calmhalbalogic
authored andcommitted
Handle depth better
1 parent 6e99fc7 commit d8ca902

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,12 @@ func parseInodeChanges(lines [][]string) ([]*InodeChange, error) {
267267
}
268268

269269
func listByType(t, filter string, depth int) ([]*Dataset, error) {
270-
args := []string{"get", fmt.Sprintf("-d%d", depth), "-rHp", "-t", t, "all"}
270+
var args []string
271+
if depth > 0 {
272+
args = []string{"get", fmt.Sprintf("-d%d", depth), "-rHp", "-t", t, "all"}
273+
} else {
274+
args = []string{"get", "-rHp", "-t", t, "all"}
275+
}
271276
if filter != "" {
272277
args = append(args, filter)
273278
}

0 commit comments

Comments
 (0)