]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'dt/refs-backend-preamble'
authorJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 18:01:29 +0000 (11:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 18:01:29 +0000 (11:01 -0700)
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

1  2 
Documentation/git-tag.txt
builtin/checkout.c
builtin/update-ref.c
refs.c
refs.h

index 4b04c2b7d500521f1cf963a89ed010512faa29c6,231298065fa0d2a2c94b022f7e0ecc348479ce95..84f6496bf228454acaa04e570f7857ba1975cda4
@@@ -13,7 -13,8 +13,7 @@@ SYNOPSI
        <tagname> [<commit> | <object>]
  'git tag' -d <tagname>...
  'git tag' [-n[<num>]] -l [--contains <commit>] [--points-at <object>]
-       [--column[=<options>] | --no-column] [<pattern>...]
+       [--column[=<options>] | --no-column] [--create-reflog] [<pattern>...]
 -      [<pattern>...]
  'git tag' -v <tagname>...
  
  DESCRIPTION
Simple merge
index 6763cf1837db99442a7140fe5bb87a0b3a1248fd,9046443731a3a4b14b4ab55b71686a2495155f87..04dd00f734166acc9c0670de061c4612877a7187
@@@ -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);
  }
diff --cc refs.c
Simple merge
diff --cc refs.h
Simple merge