Thread (59 messages) flat view 59 messages, 7 authors, 2018-03-10

Re: Change in output as a result of patch

From: Kaartic Sivaraam <hidden>
Date: 2017-08-07 14:49:09

Possibly related (same subject, not in this thread)

On Mon, 2017-07-24 at 14:25 -0700, Junio C Hamano wrote:
I suspect that with a moderately-sized refactoring around
validate_new_branchname() function, this should be doable.  Instead
of passing two "int" parameters force and attr_only, make them into
a single "unsigned flag"
I guess it's not possible to merge the two parameters into one as the
following code path shouldn't be taken when 'attr_only' is set,

    if (!attr_only) {
    	    const char *head;
    	    struct object_id oid;

    	    head = resolve_ref_unsafe("HEAD", 0, oid.hash, NULL);
    	    if (!is_bare_repository() && head && !strcmp(head, ref->buf))
    	    	    die(_("Cannot force update the current branch."));
    }

and I guess this means the 'attr_only' can't merged with 'force'.

Further, I saw this in 'branch.h'
 NEEDSWORK: This needs to be split into two separate functions in the
 longer run for sanity.
Any ways in which I could help with this?

-- 
Kaartic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help