summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-22 11:24:11 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-22 11:24:11 -0700
commit988f98f61fc80021311c2d161084c03a55f7354d (patch)
treeb38485fc5a6b4e4fd70c37cf93e76cdeaae6a6b8 /setup.c
parentc714f9fd8addc752aaaf1f97bb2be311d9156def (diff)
parentabd4284bc62127a2db69c8c81501a56bb29284c8 (diff)
downloadgit-988f98f61fc80021311c2d161084c03a55f7354d.tar.gz
Merge branch 'jx/clean-interactive'
Add "interactive" mode to "git clean". The early part to refactor relative path related helper functions looked sensible. * jx/clean-interactive: test: run testcases with POSIX absolute paths on Windows test: add t7301 for git-clean--interactive git-clean: add documentation for interactive git-clean git-clean: add ask each interactive action git-clean: add select by numbers interactive action git-clean: add filter by pattern interactive action git-clean: use a git-add-interactive compatible UI git-clean: add colors to interactive git-clean git-clean: show items of del_list in columns git-clean: add support for -i/--interactive git-clean: refactor git-clean into two phases write_name{_quoted_relative,}(): remove redundant parameters quote_path_relative(): remove redundant parameter quote.c: substitute path_relative with relative_path path.c: refactor relative_path(), not only strip prefix test: add test cases for relative_path
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 88aab94f15..5262319be6 100644
--- a/setup.c
+++ b/setup.c
@@ -360,6 +360,7 @@ int is_inside_work_tree(void)
void setup_work_tree(void)
{
+ struct strbuf sb = STRBUF_INIT;
const char *work_tree, *git_dir;
static int initialized = 0;
@@ -379,8 +380,10 @@ void setup_work_tree(void)
if (getenv(GIT_WORK_TREE_ENVIRONMENT))
setenv(GIT_WORK_TREE_ENVIRONMENT, ".", 1);
- set_git_dir(relative_path(git_dir, work_tree));
+ set_git_dir(relative_path(git_dir, work_tree, &sb));
initialized = 1;
+
+ strbuf_release(&sb);
}
static int check_repository_format_gently(const char *gitdir, int *nongit_ok)