summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-12 06:40:54 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-12 06:40:54 (GMT)
commitf31b6ff747afeb204299b7a67ce2ec59beb33b7d (patch)
tree638c807ac0622dca1f19710b9499c058f88cd822 /lib
parent264f4a32fa898a47e37ccb6f2580746d6f36453f (diff)
parent20f1a10bfb6c31a3728a74bf1c33cb3cc5ac0c7e (diff)
downloadgit-f31b6ff747afeb204299b7a67ce2ec59beb33b7d.zip
git-f31b6ff747afeb204299b7a67ce2ec59beb33b7d.tar.gz
git-f31b6ff747afeb204299b7a67ce2ec59beb33b7d.tar.bz2
Merge branch 'maint'
* maint: git-gui: Work around bad interaction between Tcl and cmd.exe on ^{tree}
Diffstat (limited to 'lib')
-rw-r--r--lib/commit.tcl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/commit.tcl b/lib/commit.tcl
index dc7c88c..3172d7c 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -258,7 +258,18 @@ proc commit_committree {fd_wt curHEAD msg} {
# -- Verify this wasn't an empty change.
#
if {$commit_type eq {normal}} {
- set old_tree [git rev-parse "$PARENT^{tree}"]
+ set fd_ot [open "| git cat-file commit $PARENT" r]
+ fconfigure $fd_ot -encoding binary -translation lf
+ set old_tree [gets $fd_ot]
+ close $fd_ot
+
+ if {[string equal -length 5 {tree } $old_tree]
+ && [string length $old_tree] == 45} {
+ set old_tree [string range $old_tree 5 end]
+ } else {
+ error "Commit $PARENT appears to be corrupt"
+ }
+
if {$tree_id eq $old_tree} {
info_popup {No changes to commit.