Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
09866d6f
Commit
09866d6f
authored
Feb 18, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stash: correctly stash wd modified/index deleted
parent
57f45e7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
src/stash.c
+1
-2
tests/stash/save.c
+19
-0
No files found.
src/stash.c
View file @
09866d6f
...
@@ -313,8 +313,7 @@ static int build_workdir_tree(
...
@@ -313,8 +313,7 @@ static int build_workdir_tree(
if
((
error
=
git_commit_tree
(
&
b_tree
,
b_commit
))
<
0
)
if
((
error
=
git_commit_tree
(
&
b_tree
,
b_commit
))
<
0
)
goto
cleanup
;
goto
cleanup
;
if
((
error
=
git_diff_tree_to_workdir_with_index
(
if
((
error
=
git_diff_tree_to_workdir
(
&
diff
,
repo
,
b_tree
,
&
opts
))
<
0
)
&
diff
,
repo
,
b_tree
,
&
opts
))
<
0
)
goto
cleanup
;
goto
cleanup
;
data
.
include_changed
=
true
;
data
.
include_changed
=
true
;
...
...
tests/stash/save.c
View file @
09866d6f
...
@@ -399,3 +399,22 @@ void test_stash_save__skip_submodules(void)
...
@@ -399,3 +399,22 @@ void test_stash_save__skip_submodules(void)
assert_status
(
repo
,
"untracked_repo/"
,
GIT_STATUS_WT_NEW
);
assert_status
(
repo
,
"untracked_repo/"
,
GIT_STATUS_WT_NEW
);
}
}
void
test_stash_save__deleted_in_index_modified_in_workdir
(
void
)
{
git_index
*
index
;
git_repository_index
(
&
index
,
repo
);
cl_git_pass
(
git_index_remove_bypath
(
index
,
"who"
));
cl_git_pass
(
git_index_write
(
index
));
assert_status
(
repo
,
"who"
,
GIT_STATUS_WT_NEW
|
GIT_STATUS_INDEX_DELETED
);
cl_git_pass
(
git_stash_save
(
&
stash_tip_oid
,
repo
,
signature
,
NULL
,
GIT_STASH_DEFAULT
));
assert_blob_oid
(
"stash@{0}^0:who"
,
"a0400d4954659306a976567af43125a0b1aa8595"
);
assert_blob_oid
(
"stash@{0}^2:who"
,
NULL
);
git_index_free
(
index
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment