summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a5b63e)
raw | patch | inline | side by side (parent: 4a5b63e)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Sep 2005 21:12:08 +0000 (14:12 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 13 Sep 2005 02:15:03 +0000 (19:15 -0700) |
If you make a commit on a path, and then make the path
cache-dirty afterwards without changing its contents, 'git
checkout' to switch to another branch is prevented because
switching the branches done with 'read-tree -m -u $current
$next' detects that the path is cache-dirty, but it does not
bother noticing that the contents of the path has not been
actualy changed.
Since switching branches would involve checking out paths
different in the two branches, hence it is reasonably expensive
operation, we can afford to run update-index before running
read-tree to reduce this kind of false change from triggering
the check needlessly.
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache-dirty afterwards without changing its contents, 'git
checkout' to switch to another branch is prevented because
switching the branches done with 'read-tree -m -u $current
$next' detects that the path is cache-dirty, but it does not
bother noticing that the contents of the path has not been
actualy changed.
Since switching branches would involve checking out paths
different in the two branches, hence it is reasonably expensive
operation, we can afford to run update-index before running
read-tree to reduce this kind of false change from triggering
the check needlessly.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-checkout.sh | patch | blob | history |
diff --git a/git-checkout.sh b/git-checkout.sh
index 4e7c57a5f39894c85a6b1f8f2e1eee444808c57f..4a605cd9c6d76dc99ab0574dc3571db3b64e509c 100755 (executable)
--- a/git-checkout.sh
+++ b/git-checkout.sh
git-read-tree --reset $new &&
git-checkout-index -q -f -u -a
else
+ git-update-index --refresh >/dev/null
git-read-tree -m -u $old $new
fi