Branch: Tag:

2013-01-23

2013-01-23 20:47:08 by Marcus Comstedt <marcus@mc.pp.se>

Removed broken use of Stdio.is_file(path)

Stdio.is_file(path) should not be used to check if some path is a
file, because it is not whether path is a file or not in the working
tree which is relevant, but rather whether or not it is one in the
commit/stage being investigated. In fact, there might not even be
a working tree since this test is also run on the server.

Instead, use get_file(path,2), which returns the empty string for
directories, which should have the intended effect of not complaining
about foreign_ident being removed from directories.

438:    if(has_prefix(path, "/"))    path = path[1..];    if (search(files_to_commit, path)<0 && -  Stdio.is_file(path) && -  find_expanded_ident(get_file(path, 1))) { +  find_expanded_ident(get_file(path, 2))) {    write("Commit removes foreign_ident from unchanged file %s\n", path);    err = 1;    }