summaryrefslogtreecommitdiff
path: root/builtin-fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-25 19:44:52 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-25 19:44:52 -0700
commit23807fa0086ae6ad6980a2a1071f23ed1a6dde93 (patch)
tree7e73547d4f5187bfb985282d94d358ed7b0ca255 /builtin-fetch.c
parent3cd7388d57db4f4a29949e8de96493fb77059484 (diff)
parente57cb0158209ece040a4b873064504efd7d2ec0e (diff)
downloadgit-23807fa0086ae6ad6980a2a1071f23ed1a6dde93.tar.gz
Merge branch 'maint'
* maint: Prepare for 1.6.3.2 fix cat-file usage message and documentation fetch: report ref storage DF errors more accurately lock_ref: inform callers of unavailable ref merge-options.txt: Clarify merge --squash Conflicts: RelNotes
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r--builtin-fetch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 77acabfcc7..1eec64e9c4 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -167,6 +167,9 @@ static struct ref *get_ref_map(struct transport *transport,
return ref_map;
}
+#define STORE_REF_ERROR_OTHER 1
+#define STORE_REF_ERROR_DF_CONFLICT 2
+
static int s_update_ref(const char *action,
struct ref *ref,
int check_old)
@@ -181,9 +184,11 @@ static int s_update_ref(const char *action,
lock = lock_any_ref_for_update(ref->name,
check_old ? ref->old_sha1 : NULL, 0);
if (!lock)
- return 2;
+ return errno == ENOTDIR ? STORE_REF_ERROR_DF_CONFLICT :
+ STORE_REF_ERROR_OTHER;
if (write_ref_sha1(lock, ref->new_sha1, msg) < 0)
- return 2;
+ return errno == ENOTDIR ? STORE_REF_ERROR_DF_CONFLICT :
+ STORE_REF_ERROR_OTHER;
return 0;
}
@@ -386,7 +391,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
}
free(url);
fclose(fp);
- if (rc & 2)
+ if (rc & STORE_REF_ERROR_DF_CONFLICT)
error("some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting "
"branches", remote_name);