Merge branch 'rs/strbuf-getcwd'

Reduce the use of fixed sized buffer passed to getcwd() calls
by introducing xgetcwd() helper.

* rs/strbuf-getcwd:
  use strbuf_add_absolute_path() to add absolute paths
  abspath: convert absolute_path() to strbuf
  use xgetcwd() to set $GIT_DIR
  use xgetcwd() to get the current directory or die
  wrapper: add xgetcwd()
  abspath: convert real_path_internal() to strbuf
  abspath: use strbuf_getcwd() to remember original working directory
  setup: convert setup_git_directory_gently_1 et al. to strbuf
  unix-sockets: use strbuf_getcwd()
  strbuf: add strbuf_getcwd()
This commit is contained in:
Junio C Hamano
2014-09-02 13:27:45 -07:00
15 changed files with 191 additions and 178 deletions

View File

@ -350,7 +350,7 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
return;
}
strbuf_addstr(&objdirbuf, absolute_path(get_object_directory()));
strbuf_add_absolute_path(&objdirbuf, get_object_directory());
normalize_path_copy(objdirbuf.buf, objdirbuf.buf);
alt_copy = xmemdupz(alt, len);