replaced objects and working directory
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Jul 25, 2010, 04:20 UTC
- Message-ID
- <AANLkTi=3=MX8+U4Oq4q_RACyxFYj-HmBYXFBxxQdFf_e@mail.gmail.com>
Hi,
Should worktree (or the index) be aware of replaced objects? It seems a bit odd to do "git checkout HEAD^" then "git status" reports modification. Maybe "git status" and similar operations should also check worktree version against the replaced version, in addition to the original version?
$ git init $ echo 1 > 1 $ git add 1 $ SHA1=`git hash-object 1` $ git ci -m 1 $ echo 2 >> 1 $ git add 1 $ git ci -m 2 $ SHA2=`git hash-object 1` $ git replace $SHA1 $SHA2 $ git st # On branch master nothing to commit (working directory clean) $ git co HEAD^ $ git st # Not currently on any branch. # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: 1 # no changes added to commit (use "git add" and/or "git commit -a") $ git di
diff --git a/1 b/1 index d00491f..1191247 100644
-- Duy