| 1902 | } |
| 1903 | |
| 1904 | async log(input: { depth?: number } = {}) { |
| 1905 | const { depth = 35 } = input; |
| 1906 | try { |
| 1907 | const remoteOriginURI = await this.getRemoteOriginURI(); |
| 1908 | if (remoteOriginURI) { |
| 1909 | await git.fetch({ |
| 1910 | ...this._baseOpts, |
| 1911 | remote: 'origin', |
| 1912 | depth, |
| 1913 | singleBranch: true, |
| 1914 | tags: false, |
| 1915 | }); |
| 1916 | } |
| 1917 | |
| 1918 | return await git.log({ ...this._baseOpts, depth }); |
| 1919 | } catch (error: unknown) { |
| 1920 | if (error instanceof git.Errors.NotFoundError) { |
| 1921 | return []; |
| 1922 | } |
| 1923 | |
| 1924 | throw error; |
| 1925 | } |
| 1926 | } |
| 1927 | |
| 1928 | async branch(branch: string, checkout = false) { |
| 1929 | console.log('[git] Branch', { |