Skip to content

fix for missing .git directory from a tracked repository - #5297

Merged
outofambit merged 11 commits into
masterfrom
where-have-all-the-good-statuses-gone
Jul 31, 2018
Merged

outofambit merged 11 commits into
masterfrom
where-have-all-the-good-statuses-gone

Conversation

@shiftkey

@shiftkey shiftkey commented Jul 31, 2018 •

Copy link
Copy Markdown
Member

Fixes #5291 by:

  • reordering the checks for updating the repository indicators because of this call stack:

This code path shows that withAuthenticatingUser can indirectly call getRemotes (which requires a valid Git repository) before we do a getStatus, which causes the error initially reported.

  • teach getStatus about exit code 128

By reordering the checks so that git status fires before git fetch we now also need to check for exit code 128 there. This required returning the exit code from the spawned process response, and handling that correctly. I've added some debug logging to this code path so it doesn't pollute the file logs excessively.

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 31, 2018
@shiftkey shiftkey added this to the 1.3.2 milestone Jul 31, 2018
Comment thread app/src/lib/git/status.ts Outdated
repository.path,
'getStatus'
'getStatus',
new Set<number>([0, 128])

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/test/unit/git/status-test.ts Outdated
})

it('returns null for directory without a .git directory', async () => {
const emptyDir = mkdirSync('no-repo-here')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


const gitStore = this.getGitStore(repository)

const status = await gitStore.loadStatus()

This comment was marked as spam.

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🖌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants