/* allow template config file to override the default */
if (log_all_ref_updates == -1)
git_config_set("core.logallrefupdates", "true");
- if (work_tree != git_work_tree_cfg)
+ if (prefixcmp(git_dir, work_tree) ||
+ strcmp(git_dir + strlen(work_tree), "/.git")) {
git_config_set("core.worktree", work_tree);
+ }
}
- /* Check if symlink is supported in the work tree */
if (!reinit) {
+ /* Check if symlink is supported in the work tree */
path[len] = 0;
strcpy(path + len, "tXXXXXX");
if (!close(xmkstemp(path)) &&
extern char *get_graft_file(void);
extern int set_git_dir(const char *path);
extern const char *get_git_work_tree(void);
+extern const char *read_gitfile_gently(const char *path);
+ extern void set_git_work_tree(const char *tree);
#define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
#include "remote.h"
#include "refs.h"
+ static struct refspec s_tag_refspec = {
+ 0,
+ 1,
++ 0,
+ "refs/tags/",
+ "refs/tags/"
+ };
+
+ const struct refspec *tag_refspec = &s_tag_refspec;
+
struct counted_string {
size_t len;
const char *s;
char *dst;
};
+ extern const struct refspec *tag_refspec;
+
struct ref *alloc_ref(unsigned namelen);
+struct ref *alloc_ref_from_str(const char* str);
+
struct ref *copy_ref_list(const struct ref *ref);
int check_ref_type(const struct ref *ref, int flags);
cd "$base_dir"
+ rm -f $U
+
test_expect_success 'cloning with reference (no -l -s)' \
- 'git clone --reference B "file://$(pwd)/A" D'
-'GIT_DEBUG_SEND_PACK=3 git clone --reference B file://`pwd`/A D 3>$U'
++'GIT_DEBUG_SEND_PACK=3 git clone --reference B "file://$(pwd)/A" D 3>$U'
+
+ test_expect_success 'fetched no objects' \
+ '! grep "^want" $U'
cd "$base_dir"