Commit 5e6542003e32ce59a8a586f00a7104aaef21fb00

Alan Rogers 2014-06-04T11:53:44

Implement GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/diff.c b/src/diff.c
index 00e6fef..b55d123 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -995,7 +995,10 @@ static int handle_unmatched_new_item(
 	}
 
 	else if (nitem->mode == GIT_FILEMODE_UNREADABLE) {
-		delta_type = GIT_DELTA_UNREADABLE;
+		if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED))
+			delta_type = GIT_DELTA_UNTRACKED;
+		else
+			delta_type = GIT_DELTA_UNREADABLE;
 	}
 
 	/* Actually create the record for this item if necessary */