Skip to content

Commit

Permalink
fix: update-index executed outside of repo context
Browse files Browse the repository at this point in the history
should fix #239
  • Loading branch information
adrianjost committed Aug 1, 2023
1 parent 75e8294 commit fcbe04a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ module.exports = {
return porcelainParse(statusOutput).length !== 0;
};

const refreshIndex = async () => {
await execCmd("git update-index --really-refresh");
};

const commitAll = async () => {
if (!(await hasChanges())) {
logger.info("NO CHANGES DETECTED");
Expand All @@ -88,6 +84,7 @@ module.exports = {
const commands = [
`git config --local user.name "${GIT_USERNAME}"`,
`git config --local user.email "${GIT_EMAIL}"`,
`git update-index --really-refresh`,
`git add -A`,
`git status`,
`git commit --message "${commitMessage}"`,
Expand All @@ -112,7 +109,6 @@ module.exports = {
return {
clone,
commitAll,
refreshIndex,
};
},
};
3 changes: 0 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ const main = async () => {
),
]);

// REFRESH INDEX
await gitRepo.refreshIndex();

// COMMIT UPDATES
await gitRepo.commitAll();

Expand Down

0 comments on commit fcbe04a

Please sign in to comment.