From f269048754f3b835f4f7287c5a132714a059efce Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 11 May 2013 18:16:52 +0200 Subject: fetch: opportunistically update tracking refs When we run a regular "git fetch" without arguments, we update the tracking refs according to the configured refspec. However, when we run "git fetch origin master" (or "git pull origin master"), we do not look at the configured refspecs at all, and just update FETCH_HEAD. We miss an opportunity to update "refs/remotes/origin/master" (or whatever the user has configured). Some users find this confusing, because they would want to do further comparisons against the old state of the remote master, like: $ git pull origin master $ git log HEAD...origin/master In the currnet code, they are comparing against whatever commit happened to be in origin/master from the last time they did a complete "git fetch". This patch will update a ref from the RHS of a configured refspec whenever we happen to be fetching its LHS. That makes the case above work. The downside is that any users who really care about whether and when their tracking branches are updated may be surprised. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/pull-fetch-param.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 6f5ca21748..18cffc25b8 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -75,4 +75,4 @@ ifdef::git-pull[] * A parameter without a colon merges into the current branch, endif::git-pull[] - while not storing the branch anywhere locally. + and updates the remote-tracking branches (if any). -- cgit v1.2.3