From 7d2adda61c1d557a01c64321f3c42a7e8004bea5 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Wed, 15 Oct 2008 15:59:04 -0400 Subject: [PATCH] check_commit, cmd_switch: git apply needs to run from repo-root This fixes some irregularities with commit, revert, etc, when run from a subdirectory --- yap/yap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yap/yap.py b/yap/yap.py index a30c88b..3f3a3d4 100644 --- a/yap/yap.py +++ b/yap/yap.py @@ -254,7 +254,8 @@ class YapCore(object): if '-d' not in flags and self._get_unstaged_files(): if '-a' not in flags and self._get_staged_files(): raise YapError("Staged and unstaged changes present. Specify what to commit") - os.system("git diff-files -p | git apply --cached") + cdup = self._get_cdup() + os.system("git diff-files -p | (cd %s; git apply --cached)" % cdup) for f in self._get_new_files(): self._stage_one(f) @@ -779,7 +780,8 @@ of history. staged = bool(self._get_staged_files()) - run_command("git diff-files -p | git apply --cached") + cdup = self._get_cdup() + run_command("git diff-files -p | (cd %s; git apply --cached)" % cdup) for f in self._get_new_files(): self._stage_one(f) -- 2.11.4.GIT