Re: [PATCH 1/3] git-branch: add --track and --no-track options

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paolo Bonzini
Date: Monday, March 5, 2007 - 10:22 am

> Yes, you also check real_ref instead of checking if dwim_ref() returned 0. 

There is.  The man page says "Scanning stops when an input character does not match such a format character."  Scanning includes not processing %n elements, either.

Regarding dwim_ref, dwim_ref says:

int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref)
{
        const char **p, *r;
        int refs_found = 0;

        *ref = NULL;

and since this "*ref" is not used anyway in the rest of the routine, I figured out that it's part of the interface to set "*ref" to NULL if no ref is found.  Of course it could help (hint hint) if extern functions had a comment stating the interface.

I see however that I also have a "real_ref = NULL" that is actually pointless; I can take it away of course.


Go down this way and you will say that printf is useless too.

Paolo
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 7:50 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 8:58 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 9:09 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 10:16 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Paolo Bonzini, (Mon Mar 5, 10:22 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 11:37 am)
Re: [PATCH 1/3] git-branch: add --track and --no-track options, Johannes Schindelin, (Mon Mar 5, 4:09 pm)