diff --git a/ObjectiveGit/GTRepository+Stashing.h b/ObjectiveGit/GTRepository+Stashing.h index 10f3e3773..364d8a720 100644 --- a/ObjectiveGit/GTRepository+Stashing.h +++ b/ObjectiveGit/GTRepository+Stashing.h @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN /// /// index - The index of the stash to apply. 0 is the latest one. /// flags - The flags to use when applying the stash. -/// options - The options to use when checking out. +/// options - The options to use when checking out (if nil, use the defaults provided by libgit2). /// error - If not NULL, set to any error that occurred. /// progressBlock - A block that will be executed on each step of the stash application. /// @@ -77,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN /// /// index - The index of the stash to apply. 0 is the most recent stash. /// flags - The flags to use when applying the stash. -/// options - The options to use when checking out. +/// options - The options to use when checking out (if nil, use the defaults provided by libgit2). /// error - If not NULL, set to any error that occurred. /// progressBlock - A block that will be executed on each step of the stash application. /// diff --git a/ObjectiveGit/GTRepository+Stashing.m b/ObjectiveGit/GTRepository+Stashing.m index 10a95c8fd..981a53d6f 100644 --- a/ObjectiveGit/GTRepository+Stashing.m +++ b/ObjectiveGit/GTRepository+Stashing.m @@ -63,6 +63,7 @@ - (BOOL)applyStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)fl git_stash_apply_options stash_options = GIT_STASH_APPLY_OPTIONS_INIT; stash_options.flags = (git_stash_apply_flags)flags; + if (progressBlock != nil) { stash_options.progress_cb = stashApplyProgressCallback; stash_options.progress_payload = (__bridge void *)progressBlock; @@ -84,6 +85,7 @@ - (BOOL)popStashAtIndex:(NSUInteger)index flags:(GTRepositoryStashApplyFlag)flag git_stash_apply_options stash_options = GIT_STASH_APPLY_OPTIONS_INIT; stash_options.flags = (git_stash_apply_flags)flags; + if (progressBlock != nil) { stash_options.progress_cb = stashApplyProgressCallback; stash_options.progress_payload = (__bridge void *)progressBlock;