From 3d7fbf8a950d2a3bb170ce8f55521c5fa97967eb Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 16 Dec 2023 14:23:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/jgit/impl/ActionRepoImpl.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/source/src/main/java/one/nem/lacerta/source/jgit/impl/ActionRepoImpl.java b/source/src/main/java/one/nem/lacerta/source/jgit/impl/ActionRepoImpl.java index f589da02..ac94b96f 100644 --- a/source/src/main/java/one/nem/lacerta/source/jgit/impl/ActionRepoImpl.java +++ b/source/src/main/java/one/nem/lacerta/source/jgit/impl/ActionRepoImpl.java @@ -71,16 +71,31 @@ public class ActionRepoImpl implements ActionRepo{ @Override public void stageFile(String path) { - + Git git = getGit(); + try { + git.add().addFilepattern(path).call(); + } catch (Exception e) { // TODO-rca: エラーハンドリング + logger.error(TAG, "stageFile: " + e.getMessage()); + } } @Override public void unstageFile(String path) { - + Git git = getGit(); + try { + git.reset().addPath(path).call(); + } catch (Exception e) { // TODO-rca: エラーハンドリング + logger.error(TAG, "unstageFile: " + e.getMessage()); + } } @Override public void commit(String message) { - + Git git = getGit(); + try { + git.commit().setMessage(message).call(); + } catch (Exception e) { // TODO-rca: エラーハンドリング + logger.error(TAG, "commit: " + e.getMessage()); + } } }