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

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dbd4ab8
Change inconsistent "SHA" uses to "OID"
tiennou Jul 12, 2014
86b0019
Just use the ref's OID directly.
tiennou Jul 12, 2014
56cd7a6
Use URLs for locating the working directory.
tiennou Jul 15, 2014
37db497
Private ivars go in class extensions.
tiennou Jul 15, 2014
af1c4b5
Property-fy PBGitIndex.
tiennou Jul 15, 2014
e05a628
Move some common actions up in the responder chain.
tiennou Jul 15, 2014
65ebec8
Show HEAD in the sidebar if it's detached
tiennou Feb 13, 2015
73cf163
added stashes property to PBGitRepository.
muhqu Aug 1, 2013
86801cf
add Stashes list to Sidebar.
muhqu Aug 1, 2013
5e950cb
keep stashes in sidebar updated when repository changes
muhqu Aug 6, 2013
650fbd9
wire-up stash actions: pop, apply, drop
muhqu Aug 6, 2013
3fdc4a3
added "Stash Changes" button and "Keep Index" checkbox to Commit View.
muhqu Aug 7, 2013
297d345
wire-up stash save, with keep index option
muhqu Aug 7, 2013
9d0767e
make "Stash Changes" button inactive if working copy is clean.
muhqu Aug 7, 2013
4402136
out-comment too verbose logging
muhqu Aug 11, 2013
3b38652
added App Menu items under "Repository"
muhqu Aug 11, 2013
88442a1
improve keyboard navigation in commit dialog
muhqu Aug 7, 2013
8e0615a
quick and dirty show stash error messages via showErrorSheet
muhqu Aug 21, 2013
381cc3d
Missing initialization
tiennou Feb 13, 2015
ba99cf3
Cosmetics
tiennou Feb 13, 2015
8440a3b
Silence the analyzer
tiennou Feb 13, 2015
1aa7aae
Prevents refs/stash from being deleted
tiennou Feb 13, 2015
90a07b1
Workaround because the commit controller isn't part of the responder …
tiennou Feb 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wire-up stash actions: pop, apply, drop
Note: use of deprecated [PBGitRepository outputInWorkdirForArguments:…] should be replaced with objective-git equivalent once stash-support is available.
  • Loading branch information
muhqu authored and tiennou committed Feb 13, 2015
commit 650fbd958b907b404cc5eaf236338c7a8e087609
18 changes: 15 additions & 3 deletions Classes/Controllers/PBRefController.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,29 @@ - (void) diffWithHEAD:(PBRefMenuItem *)sender

-(void) stashPop:(id)sender
{
NSLog(@"stashPop: %@", [sender refish]);
PBGitStash * stash = [historyController.repository stashForRef:[sender refish]];
BOOL ok = [historyController.repository stashPop:stash];
if (ok) {
[historyController.repository.windowController showCommitView:sender];
}
}

-(void) stashApply:(id)sender
{
NSLog(@"stashApply: %@", [sender refish]);
PBGitStash * stash = [historyController.repository stashForRef:[sender refish]];
BOOL ok = [historyController.repository stashApply:stash];
if (ok) {
[historyController.repository.windowController showCommitView:sender];
}
}

-(void) stashDrop:(id)sender
{
NSLog(@"stashDrop: %@", [sender refish]);
PBGitStash * stash = [historyController.repository stashForRef:[sender refish]];
BOOL ok = [historyController.repository stashDrop:stash];
if (ok) {
[historyController.repository.windowController showHistoryView:sender];
}
}

-(void) stashViewDiff:(id)sender
Expand Down
3 changes: 3 additions & 0 deletions Classes/git/PBGitRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id <PBGitRefish>)commitSHA;
- (BOOL) deleteRemote:(PBGitRef *)ref;
- (BOOL) deleteRef:(PBGitRef *)ref;
- (BOOL) stashPop:(PBGitStash *)stash;
- (BOOL) stashApply:(PBGitStash *)stash;
- (BOOL) stashDrop:(PBGitStash *)stash;

- (NSURL *) gitURL ;

Expand Down
22 changes: 22 additions & 0 deletions Classes/git/PBGitRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,29 @@ - (PBGitStash *)stashForRef:(PBGitRef *)ref {
return found;
}

-(BOOL)stashRunCommand:(NSString *)command withStash:(PBGitStash *)stash
{
int retValue;
[self outputInWorkdirForArguments:@[@"stash", command, stash.ref.refishName] retValue:&retValue];
[self willChangeValueForKey:@"stashes"];
[self didChangeValueForKey:@"stashes"];
return retValue ? NO : YES;
}

-(BOOL)stashPop:(PBGitStash *)stash
{
return [self stashRunCommand:@"pop" withStash:stash];
}

-(BOOL)stashApply:(PBGitStash *)stash
{
return [self stashRunCommand:@"apply" withStash:stash];
}

-(BOOL)stashDrop:(PBGitStash *)stash
{
return [self stashRunCommand:@"drop" withStash:stash];
}

#pragma mark Remotes

Expand Down