File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Resources/html/views/commit Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -559,9 +559,6 @@ - (NSString *)diffForFile:(PBChangedFile *)file staged:(BOOL)staged contextLines
559
559
NSString *contents = [NSString stringWithContentsOfURL: fileURL
560
560
usedEncoding: &encoding
561
561
error: &error];
562
- if (error)
563
- return nil ;
564
-
565
562
return contents;
566
563
}
567
564
Original file line number Diff line number Diff line change @@ -9,9 +9,12 @@ var showNewFile = function(file)
9
9
diff . innerHTML = "" ;
10
10
11
11
var contents = Index . diffForFile_staged_contextLines_ ( file , false , contextLines ) ;
12
- if ( ! contents ) {
12
+ if ( contents === undefined ) {
13
13
notify ( "Can not display changes (Binary file?)" , - 1 ) ;
14
14
return ;
15
+ } else if ( contents . length == 0 ) {
16
+ notify ( "Empty file" , 1 ) ;
17
+ return ;
15
18
}
16
19
17
20
var pre = document . createElement ( "pre" ) ;
You can’t perform that action at this time.
0 commit comments