Skip to content

Commit

Permalink
fix files containing spaces in the Git Workspace view
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Bonomi committed Jun 12, 2024
1 parent 606820b commit 4a54916
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/WorkspaceFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ export default defineComponent({
const status = line[statusColumn];
if ((this.kind == 'staged' && status != " " && status != "?") ||
(this.kind == 'unstaged' && status != " ")) {
// Extract the name
let name = line.substring(3);
if (name.indexOf(' -> ') != -1) { // Renamed item
if (name.startsWith('"')) {
// Remove quotes and unescape special characters
name = JSON.parse(name);
}
// Handle renamed items
if (name.indexOf(' -> ') != -1) {
name = name.split(' -> ')[1];
}
const type = (name[name.length - 1] == '/') ? 'tree' : 'blob';
Expand Down

0 comments on commit 4a54916

Please sign in to comment.