Merge branch 'jk/fetch-always-update-tracking'
authorJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:57:26 +0000 (15:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:57:26 +0000 (15:57 -0700)
"git fetch origin master" unlike "git fetch origin" or "git fetch"
did not update "refs/remotes/origin/master"; this was an early
design decision to keep the update of remote tracking branches
predictable, but in practice it turns out that people find it more
convenient to opportunisticly update them whenever we have a chance,
and we have been updating them when we run "git push" which already
breaks the original "predictability" anyway.

Now such a fetch does update refs/remotes/origin/master.

* jk/fetch-always-update-tracking:
fetch: don't try to update unfetched tracking refs
fetch: opportunistically update tracking refs
refactor "ref->merge" flag
fetch/pull doc: untangle meaning of bare <ref>
t5510: start tracking-ref tests from a known state

1  2 
cache.h
diff --combined cache.h
index 7ce90611373ba9f0b3d7ab12eef53639458d241e,9670d99f2bdef5d1570ae6b808b40c66e873e656..df532f8e4a597a0c9c4d3cbb4980f5d62a106334
+++ b/cache.h
@@@ -910,7 -910,6 +910,7 @@@ void show_date_relative(unsigned long t
                        struct strbuf *timebuf);
  int parse_date(const char *date, char *buf, int bufsize);
  int parse_date_basic(const char *date, unsigned long *timestamp, int *offset);
 +int parse_expiry_date(const char *date, unsigned long *timestamp);
  void datestamp(char *buf, int bufsize);
  #define approxidate(s) approxidate_careful((s), NULL)
  unsigned long approxidate_careful(const char *, int *);
@@@ -1025,9 -1024,21 +1025,21 @@@ struct ref 
        unsigned int
                force:1,
                forced_update:1,
-               merge:1,
                deletion:1,
                matched:1;
+       /*
+        * Order is important here, as we write to FETCH_HEAD
+        * in numeric order. And the default NOT_FOR_MERGE
+        * should be 0, so that xcalloc'd structures get it
+        * by default.
+        */
+       enum {
+               FETCH_HEAD_MERGE = -1,
+               FETCH_HEAD_NOT_FOR_MERGE = 0,
+               FETCH_HEAD_IGNORE = 1
+       } fetch_head_status;
        enum {
                REF_STATUS_NONE = 0,
                REF_STATUS_OK,