Skip to content

Adds function to return last stash entry created for a branch - #7089

Closed
iAmWillShepherd wants to merge 24 commits into
create-stashfrom
the-last-stash
Closed

iAmWillShepherd wants to merge 24 commits into
create-stashfrom
the-last-stash

Conversation

@iAmWillShepherd

@iAmWillShepherd iAmWillShepherd commented Mar 14, 2019 •

Copy link
Copy Markdown
Contributor

⚠️ This builds on top of work done in #7085, so review that first if it's not merged ⚠️

Adds a function that returns the last entry created for a given branch.

See tracking issue: #6987

@iAmWillShepherd
iAmWillShepherd changed the base branch from development to all-the-stashes March 14, 2019 19:21
@iAmWillShepherd iAmWillShepherd mentioned this pull request Mar 14, 2019
6 tasks done
Comment thread app/src/lib/git/stash.ts Resolved
Comment thread app/test/unit/git/stash-test.ts Resolved
Comment thread app/test/unit/git/stash-test.ts Resolved
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 14, 2019
@shiftkey shiftkey self-assigned this Mar 18, 2019

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some initial feedback, mostly around documenting things

Comment thread app/src/lib/git/stash.ts Resolved
Comment thread app/src/lib/git/stash.ts Resolved
Comment thread app/test/unit/git/stash-test.ts Resolved
Comment thread app/test/unit/git/stash-test.ts Resolved
Comment thread app/test/unit/git/stash-test.ts Resolved
Comment thread app/src/lib/git/stash.ts Resolved
@shiftkey
shiftkey changed the base branch from all-the-stashes to development March 19, 2019 13:29
@shiftkey

Copy link
Copy Markdown
Member

As #7032 has been merged I changed the base branch back to development to indicate this is unblocked.

@iAmWillShepherd
iAmWillShepherd changed the base branch from development to create-stash March 19, 2019 20:54

async function stash(repository: Repository, message?: string) {
const tipSha = await getTipSha(repository)
it('returns null when no stash entries exist for branch', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about a test when no stashes are created in the repository?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The function operates at the branch level, so I don't think testing for stashes in a repo would give us much. I've updated the name of the function to make its purpose more clear.

@shiftkey shiftkey Mar 20, 2019 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wasn't that worried about the function name, given it's parameterized accordingly - I just didn't quite understand this test summary versus the implementation.

What about this test description for the current test:

returns null when no stash entries match branch name

This might then motivate creating an additional test to cover a related scenario

returns null when no stash entries created

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The function operates at the branch level, so I don't think testing for stashes in a repo would give us much.

This might be correct, but we also don't have a test for getDesktopStashEntries to ensure it handles when no stashes exist. We only cover "unborn repository" and "returns created stashes". That's the gap I'd like to cover here.

Comment thread app/test/unit/git/stash-test.ts Resolved
@shiftkey shiftkey removed their assignment Mar 23, 2019
@shiftkey

Copy link
Copy Markdown
Member

I'm going to drop ready-for-review here because it's dependent on #7085 which currently has some testing issues.

@shiftkey shiftkey removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Mar 25, 2019
@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Closing in favor of #7182.

@iAmWillShepherd
iAmWillShepherd deleted the the-last-stash branch April 5, 2019 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants