summaryrefslogtreecommitdiff
path: root/src/stash.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-02 12:07:27 -0700
committerRussell Belfer <rb@github.com>2014-04-22 15:23:43 -0700
commit24d17de255caa57b01c0c758e6fc81aad493806e (patch)
tree5d4831849777583e4cd2d6b46ac6a7a532fa468b /src/stash.c
parenta32d684f866e7710fd139d69ad5d1a8d0ae527c4 (diff)
downloadlibgit2-24d17de255caa57b01c0c758e6fc81aad493806e.tar.gz
Make stash and checkout ignore contained repos
To emulate git, stash should not remove untracked git repositories inside the parent repo, and checkout's REMOVE_UNTRACKED should also skip over these items. `git stash` actually prints a warning message for these items. That should be possible with a checkout notify callback if you wanted to, although it would require a bit of extra logic as things are at the moment.
Diffstat (limited to 'src/stash.c')
-rw-r--r--src/stash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stash.c b/src/stash.c
index d20e29b80..86e0a627c 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -178,7 +178,8 @@ static int stash_update_index_from_diff(
break;
case GIT_DELTA_UNTRACKED:
- if (data->include_untracked)
+ if (data->include_untracked &&
+ delta->new_file.mode != GIT_FILEMODE_TREE)
add_path = delta->new_file.path;
break;