992 } else if (target instanceof Commit) {
993 moveTo = target.hash;
994 } else {
995 moveTo = target; 996 }
997 return this.repoLog.writeLog(`checkout: move from '${oldHeadHash}' to ${targetCommit.hash} with ${reset}`);
998 });
820 } else if (reset & RESET.DETECTIONMODE_SIZE_AND_HASH_FOR_ALL_FILES) {
821 detectionMode = DETECTIONMODE.SIZE_AND_HASH_FOR_ALL_FILES;
822 } else if (reset & RESET.DETECTIONMODE_SIZE_AND_HASH_FOR_SMALL_FILES) {
823 detectionMode = DETECTIONMODE.SIZE_AND_HASH_FOR_SMALL_FILES; 824 }
825
826 const oldFilesMap: Map<string, TreeEntry> = targetCommit.root.getAllTreeFiles({ entireHierarchy: true, includeDirs: true });
280function getFilesystem(drive: any, mountpoint: string): Promise<FILESYSTEM> {
281 try {
282 if (process.platform === 'win32') {
283 return new Promise<string | null>((resolve, _reject) => {284 const driveLetter = mountpoint.endsWith('\\') ? mountpoint.substring(0, mountpoint.length - 1) : mountpoint;
285 exec(`fsutil fsinfo volumeinfo ${driveLetter}`, (error, stdout, _stderr) => {
286 if (error) {
282 if (process.platform === 'win32') {
283 return new Promise<string | null>((resolve, _reject) => {
284 const driveLetter = mountpoint.endsWith('\\') ? mountpoint.substring(0, mountpoint.length - 1) : mountpoint;
285 exec(`fsutil fsinfo volumeinfo ${driveLetter}`, (error, stdout, _stderr) => {286 if (error) {
287 return resolve(null); // if we can't extract the volume info, we simply skip the ReFS detection
288 }
1import test from 'ava';
2import * as crypto from 'crypto'; 3import * as fse from 'fs-extra';
4
5import {
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)