summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/ide/stores/getters.js6
-rw-r--r--app/assets/javascripts/ide/stores/utils.js4
2 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/stores/getters.js b/app/assets/javascripts/ide/stores/getters.js
index 212974c00fe..a93d29fd865 100644
--- a/app/assets/javascripts/ide/stores/getters.js
+++ b/app/assets/javascripts/ide/stores/getters.js
@@ -1,5 +1,5 @@
import { __ } from '~/locale';
-import { getChangesCountForState, filePathMatches } from './utils';
+import { getChangesCountForFiles, filePathMatches } from './utils';
export const activeFile = state => state.openFiles.find(file => file.active) || null;
@@ -69,10 +69,10 @@ export const getChangesInFolder = state => path => {
};
export const getUnstagedFilesCountForPath = state => path =>
- getChangesCountForState(state.changesFiles, path);
+ getChangesCountForFiles(state.changedFiles, path);
export const getStagedFilesCountForPath = state => path =>
- getChangesCountForState(state.stagedFiles, path);
+ getChangesCountForFiles(state.stagedFiles, path);
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};
diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js
index 1c433a87577..bc79ff4a542 100644
--- a/app/assets/javascripts/ide/stores/utils.js
+++ b/app/assets/javascripts/ide/stores/utils.js
@@ -141,5 +141,5 @@ export const sortTree = sortedTree =>
export const filePathMatches = (f, path) =>
f.path.replace(new RegExp(`${f.name}$`), '').indexOf(`${path}/`) === 0;
-export const getChangesCountForState = (state, path) =>
- state.stagedFiles.filter(f => filePathMatches(f, path)).length;
+export const getChangesCountForFiles = (files, path) =>
+ files.filter(f => filePathMatches(f, path)).length;