MCPcopy Create free account
hub / github.com/libgit2/pygit2 / Branch_rename

Function Branch_rename

src/branch.c:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 "Returns the new branch.");
113
114PyObject *
115Branch_rename(Branch *self, PyObject *args)
116{
117 int err, force = 0;
118 git_reference *c_out;
119 const char *c_name;
120
121 CHECK_REFERENCE(self);
122
123 if (!PyArg_ParseTuple(args, "s|i", &c_name, &force))
124 return NULL;
125
126 err = git_branch_move(&c_out, self->reference, c_name, force);
127 if (err == GIT_OK)
128 return wrap_branch(c_out, self->repo);
129 else
130 return Error_set(err);
131}
132
133
134PyDoc_STRVAR(Branch_branch_name__doc__,

Callers

nothing calls this directly

Calls 2

wrap_branchFunction · 0.85
Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…