]> asedeno.scripts.mit.edu Git - git.git/commit
git-gui: Make initial commits work properly.
authorShawn O. Pearce <spearce@spearce.org>
Sat, 18 Nov 2006 07:50:58 +0000 (02:50 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 18 Nov 2006 07:50:58 +0000 (02:50 -0500)
commit4539eacd6dde87b4e73c859e946bb0a2c89d71f4
treeacaa9604ce1e8d89fae2fe23556fbcd6ba71ec91
parentcbbaa28bc0a2b607b0f5e2e23f910d1619b52b0f
git-gui: Make initial commits work properly.

Apparently I never really tested the logic for making or amending an
initial commit, so although most of the code was here in git-gui it
didn't quite work as it was intended to.

So this is all just bug fixes to make initial commits correctly
generate the list of files going into the initial commit, or to
show a newly added file's diff, and to amend an initial commit.

Because we really want to diff the index against a tree-ish and
there is no such tree-ish on an initial commit we create an empty
tree through git-mktree and diff against that.  This unfortunately
creates a dangling tree, which may confuse a new user who uses
git-gui to make a new commit and then immediately afterwards runs
git fsck-objects to see if their object database is corrupt or not.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui