Merge branch 'jc/broken-ref-dwim-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2011 23:04:36 +0000 (16:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Oct 2011 23:04:36 +0000 (16:04 -0700)
* jc/broken-ref-dwim-fix:
  resolve_ref(): report breakage to the caller without warning
  resolve_ref(): expose REF_ISBROKEN flag
  refs.c: move dwim_ref()/dwim_log() from sha1_name.c

1  2 
refs.c
refs.h
sha1_name.c

diff --cc refs.c
--- 1/refs.c
--- 2/refs.c
+++ b/refs.c
@@@ -4,11 -4,11 +4,10 @@@
  #include "tag.h"
  #include "dir.h"
  
- /* ISSYMREF=01 and ISPACKED=02 are public interfaces */
- #define REF_KNOWS_PEELED 04
- #define REF_BROKEN 010
+ /* ISSYMREF=0x01, ISPACKED=0x02 and ISBROKEN=0x04 are public interfaces */
+ #define REF_KNOWS_PEELED 0x10
  
 -struct ref_list {
 -      struct ref_list *next;
 +struct ref_entry {
        unsigned char flag; /* ISSYMREF? ISPACKED? */
        unsigned char sha1[20];
        unsigned char peeled[20];
@@@ -337,9 -313,9 +336,9 @@@ static void get_ref_dir(const char *sub
                        } else
                                if (!resolve_ref(ref, sha1, 1, &flag)) {
                                        hashclr(sha1);
-                                       flag |= REF_BROKEN;
+                                       flag |= REF_ISBROKEN;
                                }
 -                      list = add_ref(ref, sha1, flag, list, NULL);
 +                      add_ref(ref, sha1, flag, array, NULL);
                }
                free(ref);
                closedir(dir);
diff --cc refs.h
Simple merge
diff --cc sha1_name.c
Simple merge