author | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Dec 2007 01:49:13 +0000 (17:49 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Dec 2007 01:49:13 +0000 (17:49 -0800) |
* maint:
git-am -i: report rewritten title
git grep shows the same hit repeatedly for unmerged paths
Do check_repository_format() early (re-fix)
Do check_repository_format() early
Add missing inside_work_tree setting in setup_git_directory_gently
git-am -i: report rewritten title
git grep shows the same hit repeatedly for unmerged paths
Do check_repository_format() early (re-fix)
Do check_repository_format() early
Add missing inside_work_tree setting in setup_git_directory_gently
1 | 2 | |||
---|---|---|---|---|
git-am.sh | patch | | diff1 | | diff2 | | blob | history |
setup.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc git-am.sh
Simple merge
diff --cc setup.c
index 2c7b5cb200414a0fa3f2727c68ea60e51b39c261,067f1be3f92c9f3a334c4b427f32b4f4fdb8225b..e96a316452197ed4b224f0c6839f036a01082bc2
+++ b/setup.c
return NULL;
}
+void setup_work_tree(void)
+{
+ const char *work_tree, *git_dir;
+ static int initialized = 0;
+
+ if (initialized)
+ return;
+ work_tree = get_git_work_tree();
+ git_dir = get_git_dir();
+ if (!is_absolute_path(git_dir))
+ set_git_dir(make_absolute_path(git_dir));
+ if (!work_tree || chdir(work_tree))
+ die("This operation must be run in a work tree");
+ initialized = 1;
+}
+
+ static int check_repository_format_gently(int *nongit_ok)
+ {
+ git_config(check_repository_format_version);
+ if (GIT_REPO_VERSION < repository_format_version) {
+ if (!nongit_ok)
+ die ("Expected git repo version <= %d, found %d",
+ GIT_REPO_VERSION, repository_format_version);
+ warning("Expected git repo version <= %d, found %d",
+ GIT_REPO_VERSION, repository_format_version);
+ warning("Please upgrade Git");
+ *nongit_ok = -1;
+ return -1;
+ }
+ return 0;
+ }
+
/*
* We cannot decide in this function whether we are in the work tree or
* not, since the config can only be read _after_ this function was called.