@@ -366,34 +366,42 @@ public void store(History history, Repository repository)
366
366
continue ;
367
367
}
368
368
369
- if (env .hasProjects ()) {
369
+ List <HistoryEntry > list = map .get (s );
370
+ if (list == null ) {
370
371
/*
371
- * Problem here is that if the original file was a symlink
372
- * it's been already dereferenced by
373
- * getPathRelativeToSourceRoot(). We have to solve the only
374
- * case which is that the symlink led to the project's root.
375
- *
376
- * @see
377
- * RuntimeEnvironment#getPathRelativeToSourceRoot(java.io.File, int)
372
+ * This means that the file has not been added yet. So we
373
+ * try to see if we should accept it.
378
374
*/
379
- Project project = Project .getProject (test );
380
- File parent = test .equals (new File (env .getSourceRootPath (), project .getPath ()))
381
- /* this is a project's root */
382
- ? test
383
- /* this isn't a project's root */
384
- : test .getParentFile ();
385
- if (!AcceptHelper .accept (project , parent , test )) {
375
+ if (env .hasProjects ()) {
376
+ /*
377
+ * Problem here is that if the original file was a
378
+ * symlink it's been already dereferenced by
379
+ * getPathRelativeToSourceRoot(). We have to solve the
380
+ * only case which is that the symlink led to the
381
+ * project's root.
382
+ *
383
+ * @see
384
+ * RuntimeEnvironment#getPathRelativeToSourceRoot(java.io.File,
385
+ * int)
386
+ */
387
+ Project project = Project .getProject (test );
388
+ File parent = test .equals (new File (env .getSourceRootPath (), project .getPath ()))
389
+ /* this is a project's root */
390
+ ? test
391
+ /* this isn't a project's root */
392
+ : test .getParentFile ();
393
+ if (!AcceptHelper .accept (project , parent , test )) {
394
+ continue ;
395
+ }
396
+ } else if (list == null && !AcceptHelper .accept (null , test .getParentFile (), test )) {
386
397
continue ;
387
398
}
388
- } else if (!AcceptHelper .accept (null , test .getParentFile (), test )) {
389
- continue ;
390
- }
391
399
392
- List <HistoryEntry > list = map .get (s );
393
- if (list == null ) {
400
+ // create a new empty record in the map
394
401
list = new ArrayList <>();
395
402
map .put (s , list );
396
403
}
404
+
397
405
/*
398
406
* We need to do deep copy in order to have different tags
399
407
* per each commit.
0 commit comments