Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Stashes.Remove #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2013
Merged

Add Stashes.Remove #375

merged 1 commit into from
Mar 28, 2013

Conversation

Saaman
Copy link
Contributor

@Saaman Saaman commented Mar 27, 2013

Following my last pull request, here is the code to drop an existing stash.

usage example :
repo.Stashes.Remove("stash@{0}");

Any comment will be appreciated!

public static void git_stash_drop(RepositorySafeHandle repo, int index)
{
int res = NativeMethods.git_stash_drop(repo, (UIntPtr)index);
Ensure.BooleanResult(res);
Copy link
Contributor

Choose a reason for hiding this comment

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

You should encapsulate these two lines in a using (ThreadAffinity()) block

@Saaman
Copy link
Contributor Author

Saaman commented Mar 28, 2013

Sorry for my styling mistakes @nulltoken, I am not yet at ease with all the code styles to follow...
I have noticed that travis failed on my last update, but it seems to be network related issues... I'm not completly sure though. Let's wait for the new build to see if it happens again.

int index;
if(!TryExtractStashIndexFromRefLog(stashRefLog, out index) || index < 0)
{
throw new ArgumentException("must be a valid stash log reference. Pattern is 'stash@{i}' where 'i' is an integer", "stashRefLog");
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential nitpick: "... where is a positive integer" ?

Copy link
Member

Choose a reason for hiding this comment

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

@Saaman Could you include this fix as a separate commit while working on #371?

@nulltoken nulltoken merged commit 7081cd6 into libgit2:vNext Mar 28, 2013
@nulltoken
Copy link
Member

Merged! 🚀

@nulltoken nulltoken mentioned this pull request Apr 3, 2013
@Saaman Saaman deleted the topic/stash-drop branch April 15, 2013 12:10
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.

3 participants