From 83a01874776b4d71ccf2e37c6609493f4571759f Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Mon, 21 Jul 2008 10:16:11 -0400 Subject: [PATCH] cmd_commit: fix initial commit --- yap/yap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yap/yap.py b/yap/yap.py index 401377c..ac98525 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -239,7 +239,7 @@ class Yap(object): def _do_commit(self, msg=None): tree = get_output("git write-tree")[0] - parent = get_output("git rev-parse --verify HEAD 2> /dev/null")[0] + parent = get_output("git rev-parse --verify HEAD 2> /dev/null") if os.environ.has_key('YAP_EDITOR'): editor = os.environ['YAP_EDITOR'] @@ -279,8 +279,8 @@ class Yap(object): fd_w.close() fd_r.close() - if parent != 'HEAD': - commit = get_output("git commit-tree '%s' -p '%s' < '%s'" % (tree, parent, tmpfile)) + if parent: + commit = get_output("git commit-tree '%s' -p '%s' < '%s'" % (tree, parent[0], tmpfile)) else: commit = get_output("git commit-tree '%s' < '%s'" % (tree, tmpfile)) -- 2.11.4.GIT