summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-01 22:00:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-01 22:00:08 (GMT)
commit1df561fb4861708ce208488aa307516c0ecfa968 (patch)
treed642bff3822cc638967d3fc6c54d2060e21ec0cf /diff-lib.c
parent259bcfb6b987021be592ed640253215bcbbf6d7d (diff)
parentff00b682f203eb39876b57404916b4c54b6032c6 (diff)
downloadgit-1df561fb4861708ce208488aa307516c0ecfa968.zip
git-1df561fb4861708ce208488aa307516c0ecfa968.tar.gz
git-1df561fb4861708ce208488aa307516c0ecfa968.tar.bz2
Merge branch 'jc/maint-reset-unmerged-path'
* jc/maint-reset-unmerged-path: reset [<commit>] paths...: do not mishandle unmerged paths
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 2e09500..b379759 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -379,7 +379,8 @@ static void do_oneway_diff(struct unpack_trees_options *o,
if (cached && idx && ce_stage(idx)) {
struct diff_filepair *pair;
pair = diff_unmerge(&revs->diffopt, idx->name);
- fill_filespec(pair->one, idx->sha1, idx->ce_mode);
+ if (tree)
+ fill_filespec(pair->one, tree->sha1, tree->ce_mode);
return;
}