From: Junio C Hamano Date: Tue, 18 Mar 2014 20:49:32 +0000 (-0700) Subject: Merge branch 'fc/transport-helper-fixes' X-Git-Tag: v2.0.0-rc0~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90e6255a6d01760d13d8ac635cca5819b0b4dbc5;p=thirdparty%2Fgit.git Merge branch 'fc/transport-helper-fixes' Updates transport-helper, fast-import and fast-export to allow the ref mapping and ref deletion in a way similar to the natively supported transports. * fc/transport-helper-fixes: remote-bzr: support the new 'force' option test-hg.sh: tests are now expected to pass transport-helper.c: do not overwrite forced bit transport-helper: check for 'forced update' message transport-helper: add 'force' to 'export' helpers transport-helper: don't update refs in dry-run transport-helper: mismerge fix --- 90e6255a6d01760d13d8ac635cca5819b0b4dbc5 diff --cc Documentation/gitremote-helpers.txt index c2908db763,e75699ce1f..64f7ad26b4 --- a/Documentation/gitremote-helpers.txt +++ b/Documentation/gitremote-helpers.txt @@@ -437,13 -437,10 +437,17 @@@ set by Git if the remote helper has th 'option check-connectivity' \{'true'|'false'\}:: Request the helper to check connectivity of a clone. + 'option force' \{'true'|'false'\}:: + Request the helper to perform a force update. Defaults to + 'false'. + +'option cloning \{'true'|'false'\}:: + Notify the helper this is a clone request (i.e. the current + repository is guaranteed empty). + +'option update-shallow \{'true'|'false'\}:: + Allow to extend .git/shallow if the new refs require it. + SEE ALSO -------- linkgit:git-remote[1] diff --cc contrib/remote-helpers/git-remote-bzr index 332aba784b,f1ba477fb8..5f4b2e3e16 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@@ -882,17 -908,8 +907,18 @@@ def main(args) global is_tmp global branches, peers global transports + global force + marks = None + is_tmp = False + gitdir = os.environ.get('GIT_DIR', None) + + if len(args) < 3: + die('Not enough arguments.') + + if not gitdir: + die('GIT_DIR not set') + alias = args[1] url = args[2] diff --cc transport-helper.c index ad72fbd53c,705dce7e04..86e1679c1e --- a/transport-helper.c +++ b/transport-helper.c @@@ -650,12 -643,12 +650,12 @@@ static int push_update_ref_status(struc struct ref *remote_refs) { char *refname, *msg; - int status; + int status, forced = 0; - if (!prefixcmp(buf->buf, "ok ")) { + if (starts_with(buf->buf, "ok ")) { status = REF_STATUS_OK; refname = buf->buf + 3; - } else if (!prefixcmp(buf->buf, "error ")) { + } else if (starts_with(buf->buf, "error ")) { status = REF_STATUS_REMOTE_REJECT; refname = buf->buf + 6; } else