Pārlūkot izejas kodu

Returns first commit if ref cannot be found

main
Eric Amodio pirms 5 gadiem
vecāks
revīzija
0cf2f6ee1e
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      src/git/gitService.ts

+ 2
- 2
src/git/gitService.ts Parādīt failu

@ -1234,10 +1234,10 @@ export class GitService implements Disposable {
const commit = options.ref && log.commits.get(options.ref);
if (commit === undefined && !options.firstIfNotFound && options.ref) {
// If the ref isn't a valid sha we will never find it, so let it fall through so we return the first
if (!Git.isSha(options.ref) || Git.isUncommitted(options.ref)) return undefined;
if (Git.isSha(options.ref) || Git.isUncommitted(options.ref)) return undefined;
}
return commit || Iterables.first(log.commits.values());
return commit ?? Iterables.first(log.commits.values());
}
@log()

Notiek ielāde…
Atcelt
Saglabāt