From: Junio C Hamano Date: Mon, 3 Aug 2015 18:01:29 +0000 (-0700) Subject: Merge branch 'dt/refs-backend-preamble' X-Git-Tag: v2.6.0-rc0~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6d323f1646d7204fc6693071e5be84377ece70b;p=thirdparty%2Fgit.git Merge branch 'dt/refs-backend-preamble' In preparation for allowing different "backends" to store the refs in a way different from the traditional "one ref per file in $GIT_DIR or in a $GIT_DIR/packed-refs file" filesystem storage, reduce direct filesystem access to ref-like things like CHERRY_PICK_HEAD from scripts and programs. * dt/refs-backend-preamble: git-stash: use update-ref --create-reflog instead of creating files update-ref and tag: add --create-reflog arg refs: add REF_FORCE_CREATE_REFLOG flag git-reflog: add exists command refs: new public ref function: safe_create_reflog refs: break out check for reflog autocreation refs.c: add err arguments to reflog functions --- b6d323f1646d7204fc6693071e5be84377ece70b diff --cc Documentation/git-tag.txt index 4b04c2b7d5,231298065f..84f6496bf2 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@@ -13,7 -13,8 +13,7 @@@ SYNOPSI [ | ] 'git tag' -d ... 'git tag' [-n[]] -l [--contains ] [--points-at ] - [--column[=] | --no-column] [...] + [--column[=] | --no-column] [--create-reflog] [...] - [...] 'git tag' -v ... DESCRIPTION diff --cc builtin/update-ref.c index 6763cf1837,9046443731..04dd00f734 --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@@ -422,14 -422,9 +429,15 @@@ int cmd_update_ref(int argc, const cha if (no_deref) flags = REF_NODEREF; if (delete) - return delete_ref(refname, oldval ? oldsha1 : NULL, flags); + /* + * For purposes of backwards compatibility, we treat + * NULL_SHA1 as "don't care" here: + */ + return delete_ref(refname, + (oldval && !is_null_sha1(oldsha1)) ? oldsha1 : NULL, + flags); else return update_ref(msg, refname, sha1, oldval ? oldsha1 : NULL, - flags, UPDATE_REFS_DIE_ON_ERR); + flags | create_reflog_flag, + UPDATE_REFS_DIE_ON_ERR); }