2010/11/11 Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>: > Currently :path and ref:path can be used to refer to a specific object > in index or ref respectively. "path" component is absolute path. This > patch allows "path" to be written as "./path" or "../path", which is > relative to user's original cwd. > > This does not work in commands for which startup_info is NULL > (i.e. non-builtin ones, it seems none of them needs this anyway). > > Signed-off-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx> > --- > Âsha1_name.c          Â|  37 ++++++++++++++++++++++-- > Ât/t1506-rev-parse-diagnosis.sh |  62 ++++++++++++++++++++++++++++++++++++++++ > Â2 files changed, 96 insertions(+), 3 deletions(-) > > diff --git a/sha1_name.c b/sha1_name.c > index 484081d..22c1df9 100644 > --- a/sha1_name.c > +++ b/sha1_name.c > @@ -1046,6 +1046,23 @@ int get_sha1_with_mode_1(const char *name, unsigned char *sha1, unsigned *mode, >    Âreturn ret; > Â} > > +static char *resolve_relative_path(const char *rel) > +{ > +    if (prefixcmp(rel, "./") && prefixcmp(rel, "../")) > +        return NULL; > + > +    if (!startup_info) > +        die("Relative path syntax is not supported in this command. Please report."); Is the "Please report." necessary? Report to who? Where? (I know we know these answers, but maybe a new user won't know them). > + > +    if (!is_inside_work_tree()) > +        die("relative path syntax can't be used outside working tree."); nit: s/relative/Relative ? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html