diff --git a/eden/scm/edenscm/ext/githelp.py b/eden/scm/edenscm/ext/githelp.py index 852904ae35617..6184ddef820f9 100644 --- a/eden/scm/edenscm/ext/githelp.py +++ b/eden/scm/edenscm/ext/githelp.py @@ -384,8 +384,10 @@ def clean(ui, repo, *args, **kwargs) -> None: args, opts = parseoptions(ui, cmdoptions, args) cmd = Command("clean") + if opts.get("d") or len(args) > 0: + cmd["--dirs"] = None if opts.get("x"): - cmd["--all"] = None + cmd["--ignored"] = None cmd.extend(args) ui.status((str(cmd)), "\n") diff --git a/eden/scm/tests/test-fb-ext-githelp.t b/eden/scm/tests/test-fb-ext-githelp.t index 7619e6efb3e43..94e926cf24e2f 100644 --- a/eden/scm/tests/test-fb-ext-githelp.t +++ b/eden/scm/tests/test-fb-ext-githelp.t @@ -272,3 +272,26 @@ githelp for git blame (tweakdefaults enabled) $ hg --config extensions.tweakdefaults= githelp -- git blame hg annotate -pudl +githelp for git clean (with path) + $ hg githelp -- git clean -f . + hg clean --dirs . + +githelp for git clean (with -d and no path) + $ hg githelp -- git clean -fd + hg clean --dirs + +githelp for git clean (with -d and path) + $ hg githelp -- git clean -fd . + hg clean --dirs . + +githelp for git clean (with -dx) + $ hg githelp -- git clean -fdx + hg clean --dirs --ignored + +githelp for git clean (with -x and path) + $ hg githelp -- git clean -fx . + hg clean --dirs --ignored . + +githelp for git clean (with -x) + $ hg githelp -- git clean -fx + hg clean --ignored \ No newline at end of file