Skip to content

Commit

Permalink
fix(statusMatrix, walk): don't remove the executable bit from file mo…
Browse files Browse the repository at this point in the history
…de (Windows-only bug) (#1444)
  • Loading branch information
billiegoose committed Dec 16, 2021
1 parent 267b017 commit 72b3987
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
10 changes: 9 additions & 1 deletion src/models/GitWalkerFs.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,15 @@ export class GitWalkerFs {
oid = await shasum(
GitObject.wrap({ type: 'blob', object: await entry.content() })
)
if (stage && oid === stage.oid) {
// Update the stats in the index so we will get a "cache hit" next time
// 1) if we can (because the oid and mode are the same)
// 2) and only if we need to (because other stats differ)
if (
stage &&
oid === stage.oid &&
stats.mode === stage.mode &&
compareStats(stats, stage)
) {
index.insert({
filepath: entry._fullpath,
stats,
Expand Down
23 changes: 13 additions & 10 deletions website/versioned_docs/version-1.x/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ original_id: log

Get commit descriptions from the git history

| param | type [= default] | description |
| -------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------- |
| [**fs**](./fs) | FsClient | a file system client |
| dir | string | The [working tree](dir-vs-gitdir.md) directory path |
| **gitdir** | string = join(dir,'.git') | The [git directory](dir-vs-gitdir.md) path |
| ref | string = 'HEAD' | The commit to begin walking backwards through the history from |
| depth | number | Limit the number of commits returned. No limit by default. |
| since | Date | Return history newer than the given date. Can be combined with `depth` to get whichever is shorter. |
| cache | object | a [cache](cache.md) object |
| return | Promise\<Array\<ReadCommitResult\>\> | Resolves to an array of ReadCommitResult objects |
| param | type [= default] | description |
| -------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| [**fs**](./fs) | FsClient | a file system client |
| dir | string | The [working tree](dir-vs-gitdir.md) directory path |
| **gitdir** | string = join(dir,'.git') | The [git directory](dir-vs-gitdir.md) path |
| filepath | string | optional get the commit for the filepath only |
| ref | string = 'HEAD' | The commit to begin walking backwards through the history from |
| depth | number | Limit the number of commits returned. No limit by default. |
| since | Date | Return history newer than the given date. Can be combined with `depth` to get whichever is shorter. |
| force | boolean = false | do not throw error if filepath is not exist (works only for a single file). defaults to false |
| follow | boolean = false | Continue listing the history of a file beyond renames (works only for a single file). defaults to false |
| cache | object | a [cache](cache.md) object |
| return | Promise\<Array\<ReadCommitResult\>\> | Resolves to an array of ReadCommitResult objects |

```ts
type ReadCommitResult = {
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-1.x/walk.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ type Stat = {
```ts
type WalkerMap = (filename: string, entries: Array<WalkerEntry>) => Promise<any>;
type WalkerMap = (filename: string, entries: Array<(WalkerEntry|null)>) => Promise<any>;
```


Expand Down

0 comments on commit 72b3987

Please sign in to comment.