Re: [PATCH v2 6/6] worktree: simplify prefixing paths
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 23, 2016, 04:31 UTC
- Message-ID
- <CAPig+cTYZORwm-Wc3JkzHaaasOxJytYiFVgayb21fWrvXnf_Bw@mail.gmail.com>
- In-Reply-To
- <CAPig+cSpoi0eMKQPqKG6+skc87dgDLZiLJZJLUk-iyd13P3E3g@mail.gmail.com>
On Sun, May 22, 2016 at 7:32 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 15 quoted lines
> On Sun, May 22, 2016 at 5:33 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote: >> @@ -467,6 +467,8 @@ int cmd_worktree(int ac, const char **av, const char *prefix) >> if (ac < 2) >> usage_with_options(worktree_usage, options); >> + if (!prefix) >> + prefix = ""; > > Considering that all the other existing git-worktree subcommands > already handle NULL prefix acceptably, it makes me a bit uncomfortable > that this "fix", which could be local to add(), leaks into all the > other subcommands, thus making the assumption that they (or other new > subcommands) will never care about the distinction between NULL and > "". > > Not a big objection; just a minor niggle, probably not worth a re-roll.
Okay, I see that you're taking advantage of the prefix="" in patch 5/6, as well, so it's not benefitting only add().